Implemented pop

This commit is contained in:
Roberto Alsina 2024-08-03 07:27:29 -03:00
parent ba9a25e56e
commit ca1c9ade6c

View File

@ -86,7 +86,10 @@ module Tartrazine
[Token.new(type: xml["type"], value: match[0])]
when "push"
lexer.state_stack << xml["state"]
return [] of Token
[] of Token
when "pop"
lexer.state_stack.pop
[] of Token
else
raise Exception.new("Unknown emitter type: #{type}: #{xml}")
end