Skip to content

Commit 88be1a9

Browse files
committed
Fix locations for macros
1 parent d35ecd7 commit 88be1a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/expr.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ let rec expand_macros_in_expr
178178
in
179179
let substituted = List.map body ~f:apply_substitution in
180180
(* Recursively expand macros in the substituted body *)
181-
List.concat_map substituted ~f:(expand_macros_in_expr macro_env)
181+
let expanded =
182+
List.concat_map substituted ~f:(expand_macros_in_expr macro_env)
183+
in
184+
(* Attach the call site location to the expanded expressions *)
185+
List.map expanded ~f:(fun e -> { e with loc = expr.loc })
182186
| None ->
183187
(* Not a macro - recursively expand in sub-expressions *)
184188
let expanded_subexprs =

0 commit comments

Comments
 (0)