Signed-off-by: Jean Privat <jean@pryen.org>
end
# Generate a sequence of `if` for the dispatch
+ if haslast != null then
+ # Special case: handle up-bound first if not an error
+ add("\t\tif c > {last} then return dfastate_{names[haslast]}\n")
+ # previous become the new last case
+ haslast = dispatch[last]
+ dispatch.keys.remove(last)
+ end
for c, next in dispatch do
if next == null then
add("\t\tif c <= {c} then return null\n")
super DFAState
redef fun trans(char) do
var c = char.code_point
+ if c > 92 then return dfastate_2
if c <= 33 then return dfastate_2
if c <= 34 then return dfastate_29
if c <= 91 then return dfastate_2
- if c <= 92 then return dfastate_30
- return dfastate_2
+ return dfastate_30
end
end
private class DFAState3