Replace Token struct with integer type

Replace _TOKEN_COUNT with INVALID_TOKEN_ID.
This commit is contained in:
josh committed 2023-07-09 22:35:02 -04:00
1 parent 6327bd1e96
commit 80ac6c17f0
3 files changed
+25 -51

No files matched your search

+4
View File
@@ -30,6 +30,10 @@ class Propane
@ptypes["default"]
end
def invalid_token_id
@tokens.size
end
private
def parse_grammar!
+1 -1
View File
@@ -62,7 +62,7 @@ class Propane
reduce_entries =
case ra = item_set.reduce_actions
when Rule
[{token_id: @grammar.tokens.size, rule_id: ra.id,
[{token_id: @grammar.invalid_token_id, rule_id: ra.id,
rule_set_id: ra.rule_set.id, n_states: ra.components.size}]
when Hash
ra.map do |token, rule|