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| states_to_push.each do |state|
if state == "#pop" if state == "#pop"
# Pop the state # Pop the state
Log.trace { "Popping state"} Log.trace { "Popping state" }
lexer.state_stack.pop lexer.state_stack.pop
else else
# Really push # Really push
lexer.state_stack << state lexer.state_stack << state
Log.trace {"Pushed #{lexer.state_stack}"} Log.trace { "Pushed #{lexer.state_stack}" }
end end
end end
[] of Token [] 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]}" } Log.trace { "Stack is #{@state_stack} State is #{state.name}, pos is #{pos}, text is #{text[pos..pos + 10]}" }
state.rules.each do |rule| state.rules.each do |rule|
matched, new_pos, new_tokens = rule.match(text, pos, self) 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 next unless matched
Log.trace { "MATCHED: #{rule.xml}" } Log.trace { "MATCHED: #{rule.xml}" }