Skip to content

Commit 1565e57

Browse files
committed
Forbid parentheses
1 parent fa32ff9 commit 1565e57

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/julia-parser.scm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,8 @@
13291329

13301330
(define (valid-func-sig? paren sig)
13311331
(and (pair? sig)
1332-
(or (memq (car sig) '(macrocall call tuple))
1332+
(or (memq (car sig) '(call tuple))
1333+
(and (not paren) (eq? (car sig) 'macrocall))
13331334
(and paren (eq? (car sig) 'block))
13341335
(and paren (eq? (car sig) '...))
13351336
(and (eq? (car sig) '|::|)

test/syntax.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3932,3 +3932,6 @@ end
39323932
@test callme(2.0) === 2
39333933
@test callme(3, 3) === 3
39343934
@test callme(4, 4, 4) === 4.0
3935+
3936+
# Ambiguous 1-arg anymous vs macrosig
3937+
@test_parseerror "function (@foo(a)) end"

0 commit comments

Comments
 (0)