Add some token constants

This commit is contained in:
josh committed 2021-06-27 23:09:42 -04:00
1 parent aae7bc188c
commit 4beb3d2016
2 files changed
+15 -8

No files matched your search

+6 -8
View File
@@ -63,19 +63,17 @@ module Imbecile
states = enumerate
states.each do |state, id|
accepts =
if state.accepts
if state.accepts.name
state.accepts.id
else
0xFFFFFFFE # drop token
end
if state.accepts.nil?
TOKEN_NONE
elsif state.accepts.name
state.accepts.id
else
0xFFFFFFFF # not an accepting state
TOKEN_DROP
end
state_table << {
transition_table_index: transition_table.size,
n_transitions: state.transitions.size,
accepts: state.accepts ? state.accepts.id : 0xFFFFFFFF,
accepts: accepts,
}
state.transitions.each do |transition|
transition_table << {