gg = '>>';
starship = '<=>';
bang='!';
+quest='?';
at='@';
semi=';';
mid_string = '}' str_body '{' | '}' '}' '}' long_str_body lsend2;
end_string = '}' str_body '"' id? | '}' '}' '}' long_str_body lsend1 id? ;
char = id? ((''' [[any - '''] - '\'] ''') | (''' '\' any ''')) id?;
-bad_string = ('"'|'}') str_body | '"' '"' '"' long_str_body | ''' ''' ''' long_sstr_body;
+bad_string = ('"'|'}') str_body ;
+bad_t_string = '"' '"' '"' long_str_body | ''' ''' ''' long_sstr_body;
bad_char = ''' '\'? any;
extern_code_segment = '`' '{' extern_code_body '`' '}';
+bad_extern = '`' '{' extern_code_body;
/*****************************************************************************/
Ignored Tokens
propdef~toplevel {-> propdef}
= {meth} [doc]:nd redef visibility kwmeth qmethid signature annotation_noend? kwdo stmtso kwend_o {-> New propdef.meth(doc.doc, redef.kwredef, visibility, kwmeth, Null, Null, Null, qmethid.methid, signature, annotation_noend.annotations, Null, Null, kwdo, stmtso.expr, kwend_o.kwend)}
| {nobody} [doc]:nd redef visibility kwmeth qmethid signature annotation_withend_nonull {-> New propdef.meth(doc.doc, redef.kwredef, visibility, kwmeth, Null, Null, Null, qmethid.methid, signature.signature, annotation_withend_nonull.annotations, Null, Null, Null, Null, Null)}
+!toplevel| {isa} [doc]:nd redef visibility kwisa annotation_noend? kwdo stmtso kwend_o {-> New propdef.meth(doc.doc, redef.kwredef, visibility, Null, Null, kwisa, Null, Null, New signature(Null, [], Null, Null), annotation_noend.annotations, Null, Null, kwdo, stmtso.expr, kwend_o.kwend)}
!toplevel| {intern_new} [doc]:nd redef visibility kwnew qmethid? signature annotation_withend_nonull {-> New propdef.meth(doc.doc, redef.kwredef, visibility, Null, Null, Null, kwnew, qmethid.methid, signature, annotation_withend_nonull.annotations, Null, Null, Null, Null, Null)}
!toplevel| {new} [doc]:nd redef visibility kwnew qmethid? signature annotation_noend? kwdo stmtso kwend_o {-> New propdef.meth(doc.doc, redef.kwredef, visibility, Null, Null, Null, kwnew, qmethid.methid, signature, annotation_noend.annotations, Null, Null, kwdo, stmtso.expr, kwend_o.kwend)}
| {extern_implicit} [doc]:nd redef visibility kwmeth qmethid signature annotation_noend? extern_calls extern_code_block {-> New propdef.meth(doc.doc, redef.kwredef, visibility, kwmeth, Null, Null, Null, qmethid.methid, signature.signature, annotation_noend.annotations, extern_calls, extern_code_block, Null, Null, Null)}
;
annotation_withend~nonull {-> annotations?}
= {oneliner} kwis annotation_list {-> New annotations(kwis, Null, Null, [annotation_list.annotation], Null, Null)}
- | {more} kwis n1 line_annotation+ kwend {-> New annotations(kwis, Null, Null, [line_annotation.annotation], Null, kwend) }
+ | {more} kwis n1 line_annotations kwend {-> New annotations(kwis, Null, Null, [line_annotations.annotation], Null, kwend) }
!nonull | {null} {-> Null}
;
annotation_noend {-> annotations}
= {oneliner} kwis annotation_list {-> New annotations(kwis, Null, Null, [annotation_list.annotation], Null, Null)}
- | {more} kwis n1 line_annotation+ {-> New annotations(kwis, Null, Null, [line_annotation.annotation], Null, Null) }
+ | {more} kwis n1 line_annotations {-> New annotations(kwis, Null, Null, [line_annotations.annotation], Null, Null) }
+ ;
+
+line_annotations {-> annotation*}
+ = {some} line_annotation* n? {-> [line_annotation.annotation] }
;
visibility
= expr_atom~nopar~nobra {-> expr_atom~nopar~nobra.expr}
| {new} kwnew no type_atom~nobra_nopar args {-> New expr.new(kwnew, type_atom~nobra_nopar.type, Null, args.exprs)}
| {isset_attr} kwisset recv~nopar~nobra qualified_o attrid {-> New expr.isset_attr(kwisset, recv~nopar~nobra.expr, attrid)}
+ | {callref} amp recv~nopar~nobra qid args {-> New expr.callref(amp, recv~nopar~nobra.expr, qid, args.exprs)}
;
expr_atom~nopar~nobra {-> expr}
| {char} char annotations_o {-> New expr.char(char, annotations_o.annotations)}
| {string} string annotations_o {-> New expr.string(string, annotations_o.annotations)}
| {superstring} superstring {-> superstring.expr}
+ | {lambdan} kwmeth signature kwdo no stmts [n2]:no kwend {-> New expr.lambda(kwmeth, signature, kwdo, stmts.expr)}
+ | {lambda0} kwmeth signature kwdo no endblock {-> New expr.lambda(kwmeth, signature, kwdo, endblock.expr)}
!nopar | {par} expr_par {-> expr_par.expr}
// !nopar to unambiguise 'foo[5].bar' between '(foo[5]).bar' and 'foo([5].bar),
!nobra!nopar | {range} obra no expr [n2]:no dotdot [n3]:no [expr2]:expr_nobra [n4]:no cbra annotations_o {-> New expr.crange(obra, expr, dotdot, expr2.expr, cbra, annotations_o.annotations)}
recv~nopar~nobra {-> expr}
= expr_atom~nopar~nobra dot no {-> expr_atom~nopar~nobra.expr}
+ | {safe} expr_atom~nopar~nobra quest dot no {-> New expr.safe(expr_atom~nopar~nobra.expr, quest)}
| {implicit} {-> New expr.implicit_self()}
;
| {attr_assign} expr [id]:attrid assign [value]:expr
| {attr_reassign} expr [id]:attrid assign_op [value]:expr
| {call} expr qid [args]:exprs
+ | {callref} amp expr qid [args]:exprs
| {call_assign} expr qid [args]:exprs assign [value]:expr
| {call_reassign} expr qid [args]:exprs assign_op [value]:expr
| {super} qualified? kwsuper [args]:exprs
| {mid_string} [string]:mid_string
| {end_string} [string]:end_string
| {superstring} [exprs]:expr* annotations?
+ | {lambda} kwmeth signature kwdo expr
| {par} opar expr cpar annotations?
| {as_cast} expr kwas opar? type cpar?
| {as_notnull} expr kwas opar? kwnot kwnull cpar?
| {debug_type} kwdebug kwtype expr type
| {vararg} expr dotdotdot
| {namedarg} id assign expr
+ | {safe} expr quest
| {type} type
| {methid} expr [id]:methid
| {at} annotations