simplify argv0 lookup a little bit.

This commit is contained in:
Kelvin Sherlock 2016-07-28 16:30:17 -04:00
parent b9782a0926
commit 56f945ce29

View File

@ -127,7 +127,7 @@
alphtype unsigned char; alphtype unsigned char;
action push { argv0.push_back(tolower(fc)); } action push { argv0.push_back(tolower(fc)); }
action break { fbreak; }
escape = 0xb6; escape = 0xb6;
ws = [ \t]; ws = [ \t];
@ -151,13 +151,15 @@
dchar = esc_seq | (any-escape-["]) $push; dchar = esc_seq | (any-escape-["]) $push;
dstring = ["] dchar** ["]; dstring = ["] dchar** ["];
# mpw doesn't handle quotes at this point,
# so simplify and stop if we see anything invalid.
main := ( main := (
ws ${ fbreak; } ws $break
| [{`] ${ argv0.clear(); fbreak; } | [|<>] $break
| sstring | 0xb7 $break
| dstring | 0xb3 $break
| esc_seq | [^a-zA-Z] ${ return COMMAND; }
| (any-escape-['"]) $push | any $push
)**; )**;
}%% }%%