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

@ -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