Skip to content

Commit

Permalink
Fix serializing (x -> y)(z) (fix #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
xitology committed Feb 19, 2024
1 parent f78b53a commit 42f8c3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/src/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ is supported.
const t1 = (1,)
const t2 = (1,2,3)
const p = 1 => 2
(x->y)(z)
Base.show(Base.stdout)
Base.@show Base.stdout
println("x = $x")
Expand Down Expand Up @@ -471,6 +472,8 @@ is supported.

const p = 1 => 2

(x -> y)(z)

Base.show(Base.stdout)

Base.@show Base.stdout
Expand Down
6 changes: 5 additions & 1 deletion src/expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,11 @@ function tile_expr_call(fn, args, pr)
sep = sep)
end
else
list_layout(Layout[tile_expr(arg, 0) for arg in args], prefix = tile_expr(fn))
prefix = tile_expr(fn)
if !@isexpr fn Expr(:. || :curly || :macroname, _...)
prefix = literal("(") * prefix * literal(")")
end
list_layout(Layout[tile_expr(arg, 0) for arg in args], prefix = prefix)
end
end

Expand Down

0 comments on commit 42f8c3a

Please sign in to comment.