mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2024-12-27 03:32:05 +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;
|
||||
|
||||
quotable = (
|
||||
[ \t\r\n]
|
||||
|
|
||||
0x00
|
||||
|
|
||||
[0x80-0xff]
|
||||
|
|
||||
[+#;&|()'"/\\{}`?*<>]
|
||||
|
|
||||
'-'
|
||||
|
|
||||
'['
|
||||
|
|
||||
']'
|
||||
[ \t\r\n]
|
||||
| 0x00
|
||||
| [0x80-0xff]
|
||||
| [+#;&|()'"/\\{}`?*<>]
|
||||
| '-'
|
||||
| '['
|
||||
| ']'
|
||||
);
|
||||
|
||||
#simpler just to say what's ok.
|
||||
normal = [A-Za-z0-9_.:];
|
||||
|
||||
main :=
|
||||
(
|
||||
normal
|
||||
|
|
||||
(any-normal) ${return true;}
|
||||
)*
|
||||
;
|
||||
main := normal*;
|
||||
}%%
|
||||
|
||||
%%write data;
|
||||
@ -43,7 +31,8 @@ bool must_quote(const std::string &s){
|
||||
|
||||
%%write init;
|
||||
%%write exec;
|
||||
return false;
|
||||
|
||||
return cs == must_quote_error;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user