Skip to content

Commit 99e975a

Browse files
authored
_expr_leaf_val: Accept Expr(:scope_layer) from JuliaLowering (#595)
1 parent 012d931 commit 99e975a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/integration/expr.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ function node_to_expr(cursor, source, txtbuf::Vector{UInt8}, txtbuf_offset::UInt
236236
Expr(:error) :
237237
Expr(:error, "$(_token_error_descriptions[k]): `$(source[srcrange])`")
238238
else
239-
val = _expr_leaf_val(cursor, txtbuf, txtbuf_offset)
239+
scoped_val = _expr_leaf_val(cursor, txtbuf, txtbuf_offset)
240+
val = @isexpr(scoped_val, :scope_layer) ? scoped_val.args[1] : scoped_val
240241
if val isa Union{Int128,UInt128,BigInt}
241242
# Ignore the values of large integers and convert them back to
242243
# symbolic/textural form for compatibility with the Expr
@@ -247,9 +248,11 @@ function node_to_expr(cursor, source, txtbuf::Vector{UInt8}, txtbuf_offset::UInt
247248
Symbol("@big_str")
248249
return Expr(:macrocall, GlobalRef(Core, macname), nothing, str)
249250
elseif is_identifier(k)
250-
return lower_identifier_name(val, k)
251+
val2 = lower_identifier_name(val, k)
252+
return @isexpr(scoped_val, :scope_layer) ?
253+
Expr(:scope_layer, val2, scoped_val.args[2]) : val2
251254
else
252-
return val
255+
return scoped_val
253256
end
254257
end
255258
end

0 commit comments

Comments
 (0)