From 185a8ea39b1dbd795aa54b7b9c82e393a9185765 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 6 Dec 2013 19:53:07 +0100 Subject: Corrected many bugs, improved error reporting. --- src/parser.mly | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/parser.mly') diff --git a/src/parser.mly b/src/parser.mly index a079886..5594430 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -71,19 +71,20 @@ prog: declaration: | p = proto b = block - { [ DFunction(p, b) ] } + { [ { d_loc = $startpos, $endpos; d_desc = DFunction(p, b) } ] } | vars = typed_vars SEMICOLON - { List.map (fun k -> DGlobal(k)) vars } + { List.map (fun k -> { d_loc = $startpos, $endpos; d_desc = DGlobal(k) }) vars } | n = cls s = supers? LBRACE PUBLIC COLON m = member* RBRACE SEMICOLON { - [ DClass({ - c_name = n; - c_supers = s; - c_members = List.flatten m; - }) ] + [ { d_loc = $startpos, $endpos; + d_desc =DClass({ + c_name = n; + c_supers = s; + c_members = List.flatten m; + }) } ] } ; -- cgit v1.2.3