X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=generate-command-parser.pl;h=b76d5e5512f8215ffec637103c8c9686c7dc97ef;hb=57822e3ed43c011ad8d28c09b31c014cd930fe9b;hp=66e44b6cd83a020924d7e7ae327d6f6eaa7e9831;hpb=71ccb4bef2850bd5beab8a4ef4669bf53b5a9781;p=i3%2Fi3 diff --git a/generate-command-parser.pl b/generate-command-parser.pl index 66e44b6c..b76d5e55 100755 --- a/generate-command-parser.pl +++ b/generate-command-parser.pl @@ -84,14 +84,14 @@ for my $line (@lines) { # Cleanup the identifier (if any). $identifier =~ s/^\s*(\S+)\s*=\s*$/$1/g; - # Cleanup the tokens (remove whitespace). - $tokens =~ s/\s*//g; - # The default action is to stay in the current state. $action = $current_state if length($action) == 0; #say "identifier = *$identifier*, token = *$tokens*, action = *$action*"; for my $token (split(',', $tokens)) { + # Cleanup trailing/leading whitespace. + $token =~ s/^\s*//g; + $token =~ s/\s*$//g; my $store_token = { token => $token, identifier => $identifier, @@ -193,7 +193,6 @@ say $callfh ' default:'; say $callfh ' printf("BUG in the parser. state = %d\n", call_identifier);'; say $callfh ' assert(false);'; say $callfh ' }'; -say $callfh ' state = result->next_state;'; say $callfh '}'; close($callfh);