mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2024-12-28 09:29:57 +00:00
clean up must_quote a little bit,
This commit is contained in:
parent
da92eb4e36
commit
34900a00b8
@ -7,31 +7,19 @@ bool must_quote(const std::string &s){
|
|||||||
alphtype unsigned char;
|
alphtype unsigned char;
|
||||||
|
|
||||||
quotable = (
|
quotable = (
|
||||||
[ \t\r\n]
|
[ \t\r\n]
|
||||||
|
|
| 0x00
|
||||||
0x00
|
| [0x80-0xff]
|
||||||
|
|
| [+#;&|()'"/\\{}`?*<>]
|
||||||
[0x80-0xff]
|
| '-'
|
||||||
|
|
| '['
|
||||||
[+#;&|()'"/\\{}`?*<>]
|
| ']'
|
||||||
|
|
|
||||||
'-'
|
|
||||||
|
|
|
||||||
'['
|
|
||||||
|
|
|
||||||
']'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#simpler just to say what's ok.
|
#simpler just to say what's ok.
|
||||||
normal = [A-Za-z0-9_.:];
|
normal = [A-Za-z0-9_.:];
|
||||||
|
|
||||||
main :=
|
main := normal*;
|
||||||
(
|
|
||||||
normal
|
|
||||||
|
|
|
||||||
(any-normal) ${return true;}
|
|
||||||
)*
|
|
||||||
;
|
|
||||||
}%%
|
}%%
|
||||||
|
|
||||||
%%write data;
|
%%write data;
|
||||||
@ -43,7 +31,8 @@ bool must_quote(const std::string &s){
|
|||||||
|
|
||||||
%%write init;
|
%%write init;
|
||||||
%%write exec;
|
%%write exec;
|
||||||
return false;
|
|
||||||
|
return cs == must_quote_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
Loading…
Reference in New Issue
Block a user