From ca1c9ade6ce9f49b176581dd0dba0093e5233436 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Sat, 3 Aug 2024 07:27:29 -0300 Subject: [PATCH] Implemented pop --- src/tartrazine.cr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tartrazine.cr b/src/tartrazine.cr index 7396da6..f5bc5f7 100644 --- a/src/tartrazine.cr +++ b/src/tartrazine.cr @@ -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