Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow @foo{...} macro calls #34505

Merged
merged 4 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
allow @foo{...} macro calls
  • Loading branch information
stevengj committed Jan 24, 2020
commit 16fdd1130b1474df00dd0a90f810e43b2df4cfe5
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Julia v1.5 Release Notes

New language features
---------------------

* Macro calls `@foo {...}` can now also be written `@foo{...}` (without the space) ([#34498]).

Language changes
----------------
Expand Down
4 changes: 4 additions & 0 deletions src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2397,6 +2397,10 @@
`(macrocall ,(macroify-name (cadr call))
,startloc
,@(cddr call)))
((and (pair? call) (eq? (car call) 'curly))
`(macrocall ,(macroify-name (cadr call))
,startloc
(braces ,@(cddr call))))
((and (pair? call) (eq? (car call) 'do))
`(do ,(macroify-call s (cadr call) startloc) ,(caddr call)))
(else
Expand Down
3 changes: 3 additions & 0 deletions test/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,6 @@ end
@test expr == Meta.parse(pf > pg ? "(x$(f)y)$(g)z" : "x$(f)(y$(g)z)")
end
end

# issue 34498
@test :(@foo{bar}) == :(@foo {bar})