Skip to content

Commit

Permalink
fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxd3 committed Mar 22, 2024
1 parent 103d005 commit 22ad3fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/varname.jl
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,10 @@ function varname(expr::Expr, concretize=Accessors.need_dynamic_optic(expr))
sym = drop_escape(sym_escaped)

# This is to handle interpolated heads -- Setfield treats them differently:
# julia> _parse_obj_optics(@q $name.a)
# (:($(Expr(:escape, :_))), :((Setfield.compose)($(Expr(:escape, :name)), (Setfield.PropertyLens){:a}())))
# julia> _parse_obj_optics(@q x.a)
# (:($(Expr(:escape, :x))), :((Setfield.compose)((Setfield.PropertyLens){:a}())))
# julia> AbstractPPL._parse_obj_optics(Meta.parse("\$name.a"))
# (:($(Expr(:escape, :_))), (:($(Expr(:escape, :name))), :((PropertyLens){:a}())))
# julia> AbstractPPL._parse_obj_optic(:(x.a))
# (:($(Expr(:escape, :x))), :(Accessors.opticcompose((PropertyLens){:a}())))
if sym != :_
sym = QuoteNode(sym)
else
Expand Down

0 comments on commit 22ad3fa

Please sign in to comment.