mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2024-12-29 15:29:19 +00:00
simplify argv0 lookup a little bit.
This commit is contained in:
parent
b9782a0926
commit
56f945ce29
16
phase2.rl
16
phase2.rl
@ -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
|
||||||
)**;
|
)**;
|
||||||
|
|
||||||
}%%
|
}%%
|
||||||
|
Loading…
Reference in New Issue
Block a user