This commit is contained in:
Roberto Alsina 2024-08-04 20:25:12 -03:00
parent b1c8793ded
commit 08347b600f
3 changed files with 4 additions and 4 deletions

View File

@ -40,12 +40,12 @@ module Tartrazine
states_to_push.each do |state|
if state == "#pop"
# Pop the state
Log.trace { "Popping state"}
Log.trace { "Popping state" }
lexer.state_stack.pop
else
# Really push
lexer.state_stack << state
Log.trace {"Pushed #{lexer.state_stack}"}
Log.trace { "Pushed #{lexer.state_stack}" }
end
end
[] of Token

View File

@ -49,7 +49,7 @@ module Tartrazine
Log.trace { "Including state #{state} from #{lexer.state_stack.last}" }
lexer.states[state].rules.each do |rule|
matched, new_pos, new_tokens = rule.match(text, pos, lexer)
Log.trace { "#{xml}, #{new_pos}, #{new_tokens}" } if matched
Log.trace { "#{xml}, #{new_pos}, #{new_tokens}" } if matched
return true, new_pos, new_tokens if matched
end
return false, pos, [] of Token

View File

@ -67,7 +67,7 @@ module Tartrazine
Log.trace { "Stack is #{@state_stack} State is #{state.name}, pos is #{pos}, text is #{text[pos..pos + 10]}" }
state.rules.each do |rule|
matched, new_pos, new_tokens = rule.match(text, pos, self)
Log.trace { "NOT MATCHED: #{rule.xml}"}
Log.trace { "NOT MATCHED: #{rule.xml}" }
next unless matched
Log.trace { "MATCHED: #{rule.xml}" }