clean up must_quote a little bit,

This commit is contained in:
Kelvin Sherlock 2016-07-23 12:58:01 -04:00
parent da92eb4e36
commit 34900a00b8

View File

@ -8,30 +8,18 @@ bool must_quote(const std::string &s){
quotable = (
[ \t\r\n]
|
0x00
|
[0x80-0xff]
|
[+#;&|()'"/\\{}`?*<>]
|
'-'
|
'['
|
']'
| 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