summaryrefslogtreecommitdiff
path: root/parser.mly
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-15 22:05:12 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-15 22:05:12 +0100
commitee85f525da54e20afe0dc7dd5583c53545dcad81 (patch)
treee466b6d0be25bd3f314ce9771f87f4223c5740cc /parser.mly
parentd15a8216ab6564a9f07d1ac8fb3a4d39cb96989d (diff)
downloadpetitcaml-ee85f525da54e20afe0dc7dd5583c53545dcad81.tar.gz
petitcaml-ee85f525da54e20afe0dc7dd5583c53545dcad81.tar.bz2
[petitcaml] Fix localisation of errors inside calls
Diffstat (limited to 'parser.mly')
-rw-r--r--parser.mly7
1 files changed, 5 insertions, 2 deletions
diff --git a/parser.mly b/parser.mly
index 583c381..e6467ec 100644
--- a/parser.mly
+++ b/parser.mly
@@ -68,7 +68,7 @@ decl:
{ (name, e, make_loc $startpos $endpos) }
| LET recur = ioption(REC) id = IDENT args = nonempty_list(motif) EQ e = expr
{ (locd_motif (Mident id) (make_loc $startpos(id) $endpos(id)),
- raw_expr (make_func id recur e args),
+ { e = (make_func id recur e args) ; t = None ; loc = e.loc },
make_loc $startpos $endpos) }
;
@@ -91,7 +91,10 @@ expr:
{ match args with
| [] -> failwith "parser.mly / expr : Unreachable matching"
| arg::args ->
- List.fold_left (fun base arg -> raw_expr (Ecall (base, arg)))
+ List.fold_left (fun base arg ->
+ { e = (Ecall (base, arg)) ;
+ t = None ;
+ loc = arg.loc })
(locd_expr (Ecall (func, arg))
(make_loc $startpos $endpos))
args }