@@ -373,14 +373,13 @@ end
373373
374374-- Takes an array of events and a map of per-line options as returned from
375375-- `get_events()`, possibly with location information stripped from push/pop events.
376- -- Returns an array of pairs {issue, option_attay} that matches each
377- -- warning or error with an array of inline option tables that affect it.
376+ -- Returns two parallel arrays, one with issues, one with option table arrays for the issues.
378377-- Some option arrays may share identity.
379- -- Returned array is sorted by warning location.
380378function inline_options .get_issues_and_affecting_options (events , per_line_opts )
381379 local pushes = utils .Stack ()
382380 local option_stack = utils .Stack ()
383- local res = {}
381+ local issues = {}
382+ local option_arrays = {}
384383 local empty_option_array = {}
385384
386385 for _ , event in ipairs (events ) do
@@ -406,7 +405,8 @@ function inline_options.get_issues_and_affecting_options(events, per_line_opts)
406405 option_array = utils .concat_arrays ({option_array , line_options })
407406 end
408407
409- table.insert (res , {event , option_array })
408+ table.insert (issues , event )
409+ table.insert (option_arrays , option_array )
410410 elseif event .options then
411411 option_stack :push (event .options )
412412 elseif event .push then
@@ -423,7 +423,7 @@ function inline_options.get_issues_and_affecting_options(events, per_line_opts)
423423 end
424424 end
425425
426- return res
426+ return issues , option_arrays
427427end
428428
429429-- Extract only warnings and errors from an array of events.
0 commit comments