fixed mixed indentation
This commit is contained in:
+10
-10
@@ -92,11 +92,11 @@ function tokenizer.tokenize(incoming_syntax, text, state)
|
|||||||
-- first.
|
-- first.
|
||||||
if subsyntax_info then
|
if subsyntax_info then
|
||||||
local ss, se = find_non_escaped(
|
local ss, se = find_non_escaped(
|
||||||
text,
|
text,
|
||||||
subsyntax_info.pattern[2],
|
subsyntax_info.pattern[2],
|
||||||
i,
|
i,
|
||||||
subsyntax_info.pattern[3]
|
subsyntax_info.pattern[3]
|
||||||
)
|
)
|
||||||
if ss and (s == nil or ss < s) then
|
if ss and (s == nil or ss < s) then
|
||||||
push_token(res, p.type, text:sub(i, ss - 1))
|
push_token(res, p.type, text:sub(i, ss - 1))
|
||||||
i = ss
|
i = ss
|
||||||
@@ -119,9 +119,9 @@ function tokenizer.tokenize(incoming_syntax, text, state)
|
|||||||
if subsyntax_info then
|
if subsyntax_info then
|
||||||
local s, e = find_non_escaped(
|
local s, e = find_non_escaped(
|
||||||
text,
|
text,
|
||||||
"^" .. subsyntax_info.pattern[2],
|
"^" .. subsyntax_info.pattern[2],
|
||||||
i,
|
i,
|
||||||
nil
|
nil
|
||||||
)
|
)
|
||||||
if s then
|
if s then
|
||||||
push_token(res, subsyntax_info.type, text:sub(i, e))
|
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
|
if type(p.pattern) == "table" then
|
||||||
state = bit32.replace(state, n, current_level*8, 8)
|
state = bit32.replace(state, n, current_level*8, 8)
|
||||||
-- If we've found a new subsyntax, bump our level, and set the
|
-- If we've found a new subsyntax, bump our level, and set the
|
||||||
-- appropriate variables.
|
-- appropriate variables.
|
||||||
if p.syntax then
|
if p.syntax then
|
||||||
current_level = current_level + 1
|
current_level = current_level + 1
|
||||||
subsyntax_info = p
|
subsyntax_info = p
|
||||||
current_syntax = type(p.syntax) == "table" and
|
current_syntax = type(p.syntax) == "table" and
|
||||||
p.syntax or syntax.get(p.syntax)
|
p.syntax or syntax.get(p.syntax)
|
||||||
current_state = 0
|
current_state = 0
|
||||||
else
|
else
|
||||||
current_state = n
|
current_state = n
|
||||||
|
|||||||
Reference in New Issue
Block a user