Skip to content

Commit

Permalink
fix(inputters): Discard duplicate values being parsed without keys in…
Browse files Browse the repository at this point in the history
… XML
  • Loading branch information
alerque committed Dec 5, 2024
1 parent 67ea929 commit 4bb31f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inputters/xml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ inputter._name = "xml"
inputter.order = 2

local function startcommand (parser, command, options)
-- Discard list values (non-key/value), stuffed by LXP/expat to make it possible to deduce the order of keys in
-- the source. We're not using it, so we don't care and it is clutter in the AST that makes it different from
-- ASTs generated from SIL inputs.
for i = 1, #options do
options[i] = nil
end
local stack = parser:getcallbacks().stack
local lno, col, pos = parser:pos()
local position = { lno = lno, col = col, pos = pos }
Expand Down

0 comments on commit 4bb31f0

Please sign in to comment.