Skip to content

Commit f336092

Browse files
committed
source line number in rule macro
1 parent ef3be31 commit f336092

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rule_dsl.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ macro rule(expr)
162162
lhs_term = makepattern(lhs, keys)
163163
unique!(keys)
164164
quote
165+
$(__source__)
165166
lhs_pattern = $(lhs_term)
166167
Rule($(QuoteNode(expr)),
167168
lhs_pattern,
168169
matcher(lhs_pattern),
169-
(__MATCHES__, __CTX__) -> $(makeconsequent(rhs)),
170+
(__MATCHES__, __CTX__) -> ($(__source__); $(makeconsequent(rhs))),
170171
rule_depth($lhs_term))
171172
end
172173
end

0 commit comments

Comments
 (0)