Fix parser for empty argument lists

This commit is contained in:
John Lorentzson 2025-07-06 22:21:40 +02:00
parent 156edc2f09
commit 5d9932637d

View file

@ -145,9 +145,12 @@ parser's debug output.")
(setf name (match-syntax primary)) (setf name (match-syntax primary))
(cond ((and (typep name 'token-name) (cond ((and (typep name 'token-name)
(match-token 'token-open-paren)) (match-token 'token-open-paren))
(setf arguments (match-syntax arglist)) (cond ((match-token 'token-close-paren)
(consume-token 'token-close-paren (setf arguments '()))
"Close parenthesis ')' is required to end function call argument list.") (t
(setf arguments (match-syntax arglist))
(consume-token 'token-close-paren
"Close parenthesis ')' is required to end function call argument list.")))
(make-instance 'node-call (make-instance 'node-call
:source *syntax-source* :source *syntax-source*
:comment *token-comment* :comment *token-comment*