Skip to content

Commit 9a4f62a

Browse files
committed
Compiler: rewrite the driver of the parser
Fix memory usage Fix comment token disapearing during recovery
1 parent c72436e commit 9a4f62a

File tree

5 files changed

+408
-308
lines changed

5 files changed

+408
-308
lines changed

compiler/lib/js_parser.mly

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ T_BACKQUOTE
208208
(* Rules type decl *)
209209
(*************************************************************************)
210210

211-
%start <[ `Annot of Js_token.Annot.t * Parse_info.t | `Item of Javascript.statement * Javascript.location] list > program
211+
%start <(Lexing.position * (Javascript.statement * Javascript.location)) list > program
212212
%start <Javascript.expression> standalone_expression
213213

214214
%%
@@ -248,8 +248,7 @@ annot:
248248
| a=TAnnot { a, pi $symbolstartpos }
249249

250250
module_item:
251-
| item { `Item $1 }
252-
| annot { `Annot $1 }
251+
| item { $symbolstartpos, $1 }
253252

254253
(*************************************************************************)
255254
(* statement *)

0 commit comments

Comments
 (0)