Store parser values according to the rule/pattern type

This commit is contained in:
josh committed 2022-11-13 22:20:30 -05:00
1 parent e4a160f918
commit c6ea4f83c2
8 files changed
+87 -24

No files matched your search

+5
View File
@@ -30,6 +30,10 @@ class Propane
# Lexer mode for this pattern.
attr_accessor :mode
# @return [String, nil]
# Parser value type name.
attr_accessor :ptypename
# Construct a Pattern.
#
# @param options [Hash]
@@ -53,6 +57,7 @@ class Propane
@token = options[:token]
@line_number = options[:line_number]
@mode = options[:mode]
@ptypename = options[:ptypename]
regex = Regex.new(@pattern)
regex.nfa.end_state.accepts = self
@nfa = regex.nfa