mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-08 12:40:25 -03:00
Compare commits
No commits in common. "6f64b76c44eaf33601e39b879603e4474361c8d1" and "56e49328fbadab7ead27c8b5b905afc2f47a860e" have entirely different histories.
6f64b76c44
...
56e49328fb
@ -42,6 +42,7 @@ known_bad = {
|
|||||||
"#{__DIR__}/tests/mcfunction/selectors.txt",
|
"#{__DIR__}/tests/mcfunction/selectors.txt",
|
||||||
"#{__DIR__}/tests/php/anonymous_class.txt",
|
"#{__DIR__}/tests/php/anonymous_class.txt",
|
||||||
"#{__DIR__}/tests/html/javascript_unclosed.txt",
|
"#{__DIR__}/tests/html/javascript_unclosed.txt",
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Tests that fail because of a limitation in PCRE2
|
# Tests that fail because of a limitation in PCRE2
|
||||||
|
@ -30,7 +30,7 @@ module Tartrazine
|
|||||||
@standalone : Bool = false,
|
@standalone : Bool = false,
|
||||||
@surrounding_pre : Bool = true,
|
@surrounding_pre : Bool = true,
|
||||||
@wrap_long_lines : Bool = false,
|
@wrap_long_lines : Bool = false,
|
||||||
@weight_of_bold : Int32 = 600)
|
@weight_of_bold : Int32 = 600,)
|
||||||
end
|
end
|
||||||
|
|
||||||
def format(text : String, lexer : Lexer) : String
|
def format(text : String, lexer : Lexer) : String
|
||||||
|
@ -94,13 +94,8 @@ module Tartrazine
|
|||||||
end
|
end
|
||||||
# If no rule matches, emit an error token
|
# If no rule matches, emit an error token
|
||||||
unless matched
|
unless matched
|
||||||
if text[pos] == "\n"
|
# Log.trace { "Error at #{pos}" }
|
||||||
# at EOL, reset state to "root"
|
tokens << {type: "Error", value: "#{text[pos]}"}
|
||||||
tokens << {type: "TextWhitespace", value: "\n"}
|
|
||||||
@state_stack = ["root"]
|
|
||||||
else
|
|
||||||
tokens << {type: "Error", value: text[pos..pos]}
|
|
||||||
end
|
|
||||||
pos += 1
|
pos += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user