Skip to content

Commit

Permalink
Forbid parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jul 31, 2024
1 parent fa32ff9 commit 1565e57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,8 @@

(define (valid-func-sig? paren sig)
(and (pair? sig)
(or (memq (car sig) '(macrocall call tuple))
(or (memq (car sig) '(call tuple))
(and (not paren) (eq? (car sig) 'macrocall))
(and paren (eq? (car sig) 'block))
(and paren (eq? (car sig) '...))
(and (eq? (car sig) '|::|)
Expand Down
3 changes: 3 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3932,3 +3932,6 @@ end
@test callme(2.0) === 2
@test callme(3, 3) === 3
@test callme(4, 4, 4) === 4.0

# Ambiguous 1-arg anymous vs macrosig
@test_parseerror "function (@foo(a)) end"

0 comments on commit 1565e57

Please sign in to comment.