diff --git a/meta/q_MLast.ml b/meta/q_MLast.ml index c0d54de..5558684 100644 --- a/meta/q_MLast.ml +++ b/meta/q_MLast.ml @@ -158,8 +158,13 @@ value class_str_item = Grammar.Entry.create gram "class_str_item"; value ipatt = Grammar.Entry.create gram "ipatt"; value let_binding = Grammar.Entry.create gram "let_binding"; +value fun_binding = Grammar.Entry.create gram "fun_binding"; value type_decl = Grammar.Entry.create gram "type_decl"; +value type_parameter = Grammar.Entry.create gram "type_parameter"; value match_case = Grammar.Entry.create gram "match_case"; +value ident = Grammar.Entry.create gram "ident"; +value mod_ident = Grammar.Entry.create gram "mod_ident"; +value patt_label_ident = Grammar.Entry.create gram "patt_label_ident"; value constructor_declaration = Grammar.Entry.create gram "constructor_declaration"; value label_declaration = @@ -280,7 +285,8 @@ EXTEND GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature structure class_type class_expr class_sig_item class_str_item let_binding type_decl constructor_declaration label_declaration match_case ipatt - with_constr poly_variant; + with_constr poly_variant ident mod_ident fun_binding type_parameter + patt_label_ident; module_expr: [ [ "functor"; "("; i = SV UIDENT; ":"; t = module_type; ")"; "->"; me = SELF -> @@ -803,6 +809,18 @@ EXTEND (Qast.List [Qast.Tuple [p; Qast.VaVal (Qast.Option None); e]])] | "->"; e = expr -> e ] ] ; + direction_flag: + [ [ "to" -> Qast.Bool True + | "downto" -> Qast.Bool False ] ] + ; +END; + +EXTEND + GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature + structure class_type class_expr class_sig_item class_str_item let_binding + type_decl constructor_declaration label_declaration match_case ipatt + with_constr poly_variant ident mod_ident fun_binding type_parameter + patt_label_ident; patt: [ LEFTA [ p1 = SELF; "|"; p2 = SELF -> Qast.Node "PaOrp" [Qast.Loc; p1; p2] ] @@ -984,13 +1002,17 @@ EXTEND | i = LIDENT -> Qast.List [mkident i] | i = UIDENT; "."; j = SELF -> Qast.Cons (mkident i) j ] ] ; - direction_flag: - [ [ "to" -> Qast.Bool True - | "downto" -> Qast.Bool False ] ] - ; typevar: [ [ "'"; i = ident -> i ] ] ; +END; + +EXTEND + GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature + structure class_type class_expr class_sig_item class_str_item let_binding + type_decl constructor_declaration label_declaration match_case ipatt + with_constr poly_variant ident mod_ident fun_binding type_parameter + patt_label_ident; (* Objects and Classes *) str_item: [ [ "class"; cd = SV (LIST1 class_declaration SEP "and") -> @@ -1183,6 +1205,14 @@ EXTEND [ [ m = UIDENT; "."; l = SELF -> Qast.Cons (mkident m) l | i = LIDENT -> Qast.List [mkident i] ] ] ; +END; + +EXTEND + GLOBAL: sig_item str_item ctyp patt expr module_type module_expr signature + structure class_type class_expr class_sig_item class_str_item let_binding + type_decl constructor_declaration label_declaration match_case ipatt + with_constr poly_variant ident mod_ident fun_binding type_parameter + patt_label_ident; (* Labels *) ctyp: AFTER "arrow" [ NONA