@@ -373,14 +373,13 @@ end
373
373
374
374
-- Takes an array of events and a map of per-line options as returned from
375
375
-- `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.
378
377
-- Some option arrays may share identity.
379
- -- Returned array is sorted by warning location.
380
378
function inline_options .get_issues_and_affecting_options (events , per_line_opts )
381
379
local pushes = utils .Stack ()
382
380
local option_stack = utils .Stack ()
383
- local res = {}
381
+ local issues = {}
382
+ local option_arrays = {}
384
383
local empty_option_array = {}
385
384
386
385
for _ , event in ipairs (events ) do
@@ -406,7 +405,8 @@ function inline_options.get_issues_and_affecting_options(events, per_line_opts)
406
405
option_array = utils .concat_arrays ({option_array , line_options })
407
406
end
408
407
409
- table.insert (res , {event , option_array })
408
+ table.insert (issues , event )
409
+ table.insert (option_arrays , option_array )
410
410
elseif event .options then
411
411
option_stack :push (event .options )
412
412
elseif event .push then
@@ -423,7 +423,7 @@ function inline_options.get_issues_and_affecting_options(events, per_line_opts)
423
423
end
424
424
end
425
425
426
- return res
426
+ return issues , option_arrays
427
427
end
428
428
429
429
-- Extract only warnings and errors from an array of events.
0 commit comments