summaryrefslogtreecommitdiff
path: root/src/parser.mly
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2013-12-06 19:53:07 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2013-12-06 19:53:07 +0100
commit185a8ea39b1dbd795aa54b7b9c82e393a9185765 (patch)
tree8dfaece32823b8ff65c2a6acadd68c23ad6453c5 /src/parser.mly
parent41149667006a5606cf142a6e73cb6748b1212045 (diff)
downloadLPC-Projet-185a8ea39b1dbd795aa54b7b9c82e393a9185765.tar.gz
LPC-Projet-185a8ea39b1dbd795aa54b7b9c82e393a9185765.zip
Corrected many bugs, improved error reporting.
Diffstat (limited to 'src/parser.mly')
-rw-r--r--src/parser.mly15
1 files changed, 8 insertions, 7 deletions
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;
+ }) } ]
}
;