You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
string"ident"^^ symbol_braces ( any_number_of ( string"ident"^^ space ^^ symbol_colon ^^string"expr"^^ space ^^ symbol_semi ) );
136
-
features ["construct_base"] ^^string"ident"^^ symbol_braces ( any_number_of ( string"ident"^^ space ^^ symbol_colon ^^string"expr"^^ space ^^ symbol_semi ) ^^ space ^^ symbol_str ".."^^ space ^^string"base" );
137
-
]
138
-
(* string "constructor" ^^ space ^^ any_number_of (string "expr") *)
141
+
either_of
142
+
[
143
+
string"ident"
144
+
^^ symbol_parens
145
+
(any_number_of (string"expr"^^ space ^^ symbol_comma));
146
+
string"ident"
147
+
^^ symbol_braces
148
+
(any_number_of
149
+
(string"ident"^^ space ^^ symbol_colon ^^string"expr"
150
+
^^ space ^^ symbol_semi));
151
+
features [ "construct_base" ]
152
+
^^string"ident"
153
+
^^ symbol_braces
154
+
(any_number_of
155
+
(string"ident"^^ space ^^ symbol_colon ^^string"expr"
156
+
^^ space ^^ symbol_semi)
157
+
^^ space ^^ symbol_str ".."^^ space ^^string"base");
158
+
]
159
+
(* string "constructor" ^^ space ^^ any_number_of (string "expr") *)
139
160
140
161
methodexpr'_Construct_tuple~super:_~components:_=
141
162
default_document_for "expr'_Construct_tuple"
@@ -161,29 +182,52 @@ struct
161
182
(symbol_str "else"^^ space ^^ symbol_braces (string"expr"))
^^ option_of ( symbol_colon ^^ space ^^string"ty" )
167
-
^^ space ^^ symbol_str ":="^^ space ^^string"expr"^^ space
168
-
^^ symbol_semi ^^ space ^^string"expr";
169
-
features ["monadic_binding"] ^^string"monadic_binding"^^ space ^^ symbol_str "<"^^ space ^^string"monad"^^ space ^^ symbol_str ">"^^ space ^^ symbol_parens (
170
-
symbol_str "|"^^ space ^^string"pat"^^ space ^^ symbol_str "|"^^ space ^^string"expr"
171
-
^^ symbol_comma
172
-
^^string"expr";
173
-
)
174
-
]
185
+
either_of
186
+
[
187
+
symbol_str "let"^^ space ^^string"pat"^^ space
188
+
^^ option_of (symbol_colon ^^ space ^^string"ty")
189
+
^^ space ^^ symbol_str ":="^^ space ^^string"expr"^^ space
190
+
^^ symbol_semi ^^ space ^^string"expr";
191
+
features [ "monadic_binding" ]
192
+
^^string"monadic_binding"^^ space ^^ symbol_str "<"^^ space
193
+
^^string"monad"^^ space ^^ symbol_str ">"^^ space
194
+
^^ symbol_parens
195
+
(symbol_str "|"^^ space ^^string"pat"^^ space
196
+
^^ symbol_str "|"^^ space ^^string"expr"^^ symbol_comma
features [ "loop" ] ^^ symbol_str "loop"^^ space ^^ symbol_braces( string"expr" );
183
-
features [ "loop"; "while_loop" ] ^^ symbol_str "while"^^ space ^^ symbol_parens( string"expr" ) ^^ space ^^ symbol_braces( string"expr" );
184
-
features [ "loop"; "for_loop" ] ^^ symbol_str "for"^^ space ^^ symbol_parens( string"pat"^^ space ^^ symbol_str "in"^^ space ^^string"expr" ) ^^ space ^^ symbol_braces ( string"expr" );
185
-
features [ "loop"; "for_index_loop" ] ^^ symbol_str "for"^^ space ^^ symbol_parens( symbol_str "let"^^ space ^^string"ident"^^ space ^^ symbol_str "in"^^ space ^^string"expr"^^ space ^^ symbol_str ".."^^ space ^^string"expr" ) ^^ space ^^ symbol_braces ( string"expr" );
features [ "reference" ] ^^ symbol_str "*"^^ space ^^string"expr";
520
-
features [ "reference"; "mutable_reference" ] ^^ symbol_str "*mut"^^ space ^^string"expr";
569
+
features [ "reference"; "mutable_reference" ]
570
+
^^ symbol_str "*mut"^^ space ^^string"expr";
521
571
]
522
572
523
573
methodty_TSlice~witness:_~ty:_=
@@ -537,7 +587,6 @@ struct
537
587
538
588
(* END GENERATED *)
539
589
end
540
-
541
590
end
542
591
543
592
moduleHaxCFG=struct
@@ -549,16 +598,16 @@ module HaxCFG = struct
549
598
end)
550
599
551
600
moduleMyAstGenerator=Ast_utils.ASTGenerator
552
-
553
601
moduleAST=Ast.Make (Features.Full)
554
602
openAST
555
603
556
604
letprint_ast (_: unit) =
557
605
let my_printer =newMyPrinter.printer in
558
606
559
-
(** Can use rendering tools for EBNF e.g. https://rr.red-dove.com/ui **)
560
-
561
-
let(my_literals, my_tys, my_pats, my_exprs, my_items) : (literal list * ty list * pat list * expr list * item list) =MyAstGenerator.generate_full_ast in
0 commit comments