Fix popping subsyntaxes that end consecutively (#1246)
This commit is contained in:
parent
8603644726
commit
271a804986
|
@ -283,13 +283,15 @@ function tokenizer.tokenize(incoming_syntax, text, state)
|
||||||
-- General end of syntax check. Applies in the case where
|
-- General end of syntax check. Applies in the case where
|
||||||
-- we're ending early in the middle of a delimiter, or
|
-- we're ending early in the middle of a delimiter, or
|
||||||
-- just normally, upon finding a token.
|
-- just normally, upon finding a token.
|
||||||
if subsyntax_info then
|
while subsyntax_info do
|
||||||
local s, e = find_text(text, subsyntax_info, i, true, true)
|
local s, e = find_text(text, subsyntax_info, i, true, true)
|
||||||
if s then
|
if s then
|
||||||
push_token(res, subsyntax_info.type, text:usub(i, e))
|
push_token(res, subsyntax_info.type, text:usub(i, e))
|
||||||
-- On finding unescaped delimiter, pop it.
|
-- On finding unescaped delimiter, pop it.
|
||||||
pop_subsyntax()
|
pop_subsyntax()
|
||||||
i = e + 1
|
i = e + 1
|
||||||
|
else
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue