summaryrefslogtreecommitdiff
path: root/parser.mly
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-15 22:40:29 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-15 22:40:29 +0100
commit656cff28c55590648b17ba36553e748cda445e2b (patch)
treed52477bf40a12bec4625773d306135aef2121474 /parser.mly
parentd044a93f39682268ffca60159bd1a0706d2d6050 (diff)
downloadpetitcaml-656cff28c55590648b17ba36553e748cda445e2b.tar.gz
petitcaml-656cff28c55590648b17ba36553e748cda445e2b.tar.bz2
[petitcaml] Fix another bunch of error localisation bugs
Diffstat (limited to 'parser.mly')
-rw-r--r--parser.mly13
1 files changed, 9 insertions, 4 deletions
diff --git a/parser.mly b/parser.mly
index 7f13b40..9f1936d 100644
--- a/parser.mly
+++ b/parser.mly
@@ -79,7 +79,10 @@ simple_expr:
| LPAREN e = expr COMMA exprs = separated_nonempty_list(COMMA, expr) RPAREN
{ locd_expr (Etuple (e::exprs)) (make_loc $startpos $endpos) }
| LBRACE exprs = separated_list(SEMICOLON, expr) RBRACE
- { List.fold_right (fun expr base -> raw_expr (Elistcons (expr, base)))
+ { List.fold_right (fun expr base ->
+ { e = (Elistcons (expr, base)) ;
+ t = None ;
+ loc = (make_start_end_loc expr.loc base.loc) })
exprs
(locd_expr (Econst (Cemptylist))
(make_loc $startpos $endpos)) }
@@ -95,9 +98,9 @@ expr:
{ e = (Ecall (base, arg)) ;
t = None ;
loc = arg.loc })
- ({ e = (Ecall (func, arg)) ;
+ { e = (Ecall (func, arg)) ;
t = None ;
- loc = (make_start_end_loc func.loc arg.loc) })
+ loc = (make_start_end_loc func.loc arg.loc) }
args }
| FUNCTION m = motif RIGHTARROW e = expr
{ locd_expr (Efunc ({ name = None ;
@@ -122,7 +125,9 @@ expr:
EQ fbody = expr IN body = expr
{ locd_expr (Eletin (locd_motif (Mident id) (make_loc $startpos(id)
$endpos(id)),
- raw_expr (make_func id recur fbody args),
+ { e = (make_func id recur fbody args) ;
+ t = None ;
+ loc = fbody.loc },
body))
(make_loc $startpos $endpos) }
| MATCH e = expr WITH