From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 05A37800BE for ; Sun, 19 Feb 2017 09:43:55 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.35,178,1484002800"; d="diff'?scan'208";a="213951691" Received: from yquem.paris.inria.fr (HELO yquem.inria.fr) ([128.93.101.33]) by mail3-relais-sop.national.inria.fr with ESMTP; 19 Feb 2017 09:43:54 +0100 Received: by yquem.inria.fr (Postfix, from userid 25991) id B2BF8E19EA; Sun, 19 Feb 2017 09:43:54 +0100 (CET) Date: Sun, 19 Feb 2017 09:43:54 +0100 From: Daniel de Rauglaudre To: Caml List Message-ID: <20170219084354.GA12744@yquem.inria.fr> References: <20170218015321.GA22237@yquem.inria.fr> <86d1efopdj.fsf@lpw25.net> <20170218103154.GA5070@yquem.inria.fr> <1487451144.4182.85.camel@gerd-stolpmann.de> <20170219030010.GA1754@yquem.inria.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] OCaml+spacetime crashes during camlp5 compilation --azLHFNyN32YCQGCU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi, On Sun, Feb 19, 2017 at 10:34:23AM +0300, Kakadu wrote: > Can you send me a diff of your splitting? I tried to do this but is > seems that I only introduced some bugs.... Included. But now, I am not sure that the problem really comes from this EXTEND. BTW, I found a bug about locations on error messages (giving as source file and no location). People should pull the new version of Camlp5 on github. (This bug is independent from the compilation of q_MLast.cmo.) -- Daniel de Rauglaudre http://pauillac.inria.fr/~ddr/ --azLHFNyN32YCQGCU Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="q_MLast.ml.diff" 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 --azLHFNyN32YCQGCU--