Do not accept 0-length tokens
This commit is contained in:
parent
7f54778ba8
commit
930ac56148
@ -33,7 +33,9 @@ module Imbecile
|
|||||||
end
|
end
|
||||||
|
|
||||||
def process_nfa_state_set(nfa_state_set)
|
def process_nfa_state_set(nfa_state_set)
|
||||||
state = @states[@nfa_state_sets[nfa_state_set]]
|
state_id = @nfa_state_sets[nfa_state_set]
|
||||||
|
state = @states[state_id]
|
||||||
|
if state_id > 0
|
||||||
nfa_state_set.each do |nfa_state|
|
nfa_state_set.each do |nfa_state|
|
||||||
if nfa_state.accepts
|
if nfa_state.accepts
|
||||||
if state.accepts
|
if state.accepts
|
||||||
@ -45,6 +47,7 @@ module Imbecile
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
transitions = transitions_for(nfa_state_set)
|
transitions = transitions_for(nfa_state_set)
|
||||||
while transitions.size > 0
|
while transitions.size > 0
|
||||||
subrange = CodePointRange.first_subrange(transitions.map(&:code_point_range))
|
subrange = CodePointRange.first_subrange(transitions.map(&:code_point_range))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user