Allow token definition with no pattern

This commit is contained in:
Josh Holtrop 2021-05-17 22:40:23 -04:00
parent 39f164a7db
commit cf8718b69c

View File

@ -21,7 +21,7 @@ module Imbecile
@modulename = $1
elsif line =~ /^\s*class\s+(\S+)$/
@classname = $1
elsif line =~ /^\s*token\s+(\S+)\s+(.*)$/
elsif line =~ /^\s*token\s+(\S+)(?:\s+(.*))?$/
name, expr = $1, $2
if expr == ""
expr = name