diff options
Diffstat (limited to 'tool/lrama/lib/lrama/grammar/destructor.rb')
-rw-r--r-- | tool/lrama/lib/lrama/grammar/destructor.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tool/lrama/lib/lrama/grammar/destructor.rb b/tool/lrama/lib/lrama/grammar/destructor.rb new file mode 100644 index 0000000000..a2b6fde0ed --- /dev/null +++ b/tool/lrama/lib/lrama/grammar/destructor.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Lrama + class Grammar + class Destructor < Struct.new(:ident_or_tags, :token_code, :lineno, keyword_init: true) + def translated_code(tag) + Code::DestructorCode.new(type: :destructor, token_code: token_code, tag: tag).translated_code + end + end + end +end |