fixed mixed indentation

This commit is contained in:
lqdev 2021-05-18 17:52:18 +02:00
parent 92322986b8
commit ba4fbde33d
1 changed files with 28 additions and 28 deletions

View File

@ -92,11 +92,11 @@ function tokenizer.tokenize(incoming_syntax, text, state)
-- first.
if subsyntax_info then
local ss, se = find_non_escaped(
text,
subsyntax_info.pattern[2],
i,
subsyntax_info.pattern[3]
)
text,
subsyntax_info.pattern[2],
i,
subsyntax_info.pattern[3]
)
if ss and (s == nil or ss < s) then
push_token(res, p.type, text:sub(i, ss - 1))
i = ss
@ -119,9 +119,9 @@ function tokenizer.tokenize(incoming_syntax, text, state)
if subsyntax_info then
local s, e = find_non_escaped(
text,
"^" .. subsyntax_info.pattern[2],
i,
nil
"^" .. subsyntax_info.pattern[2],
i,
nil
)
if s then
push_token(res, subsyntax_info.type, text:sub(i, e))
@ -149,12 +149,12 @@ function tokenizer.tokenize(incoming_syntax, text, state)
if type(p.pattern) == "table" then
state = bit32.replace(state, n, current_level*8, 8)
-- If we've found a new subsyntax, bump our level, and set the
-- appropriate variables.
-- appropriate variables.
if p.syntax then
current_level = current_level + 1
subsyntax_info = p
current_syntax = type(p.syntax) == "table" and
p.syntax or syntax.get(p.syntax)
p.syntax or syntax.get(p.syntax)
current_state = 0
else
current_state = n