long_str_char = str_char | cr | lf;
+// because no substraction in sablecc3, complex long strings are difficult to express
+ls1 = '"' '"'? ;
+ls2 = '{' '{'? ;
+ls12 = ls1? (ls2 ls1)* ls2?;
+
long_str_part
- = long_str_char
- | '"' long_str_char
- | '"' '"' long_str_char
- | '{' long_str_char
- | '{' '{' long_str_char
+ = ls12 long_str_char
;
long_str_body = long_str_part*;
+lsend1 = ls2? (ls1 ls2)* '"""';
+lsend2 = ls1? (ls2 ls1)* '{{{';
long_sstr_char = sstr_char | cr | lf;
long_sstr_part
number = digit+;
float = digit* '.' digit+;
-string = '"' str_body '"' | '"' '"' '"' long_str_body '"' '"' '"' | ''' ''' ''' long_sstr_body ''' ''' ''';
-start_string = '"' str_body '{' | '"' '"' '"' long_str_body '{' '{' '{';
-mid_string = '}' str_body '{' | '}' '}' '}' long_str_body '{' '{' '{';
-end_string = '}' str_body '"' | '}' '}' '}' long_str_body '"' '"' '"';
+string = '"' str_body '"' | '"' '"' '"' long_str_body lsend1 | ''' ''' ''' long_sstr_body ''' ''' ''';
+start_string = '"' str_body '{' | '"' '"' '"' long_str_body lsend2;
+mid_string = '}' str_body '{' | '}' '}' '}' long_str_body lsend2;
+end_string = '}' str_body '"' | '}' '}' '}' long_str_body lsend1;
char = (''' [[any - '''] - '\'] ''') | (''' '\' any ''');
bad_string = ('"'|'}') str_body | '"' '"' '"' long_str_body | ''' ''' ''' long_sstr_body;
bad_char = ''' '\'? any;