mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-17 19:11:22 -05:00
Existence checks on functions now supported.
This commit is contained in:
@@ -312,14 +312,19 @@ grammar =
|
||||
|
||||
# Ordinary function invocation, or a chained series of calls.
|
||||
Invocation: [
|
||||
o "Value Arguments", -> new CallNode $1, $2
|
||||
o "Invocation Arguments", -> new CallNode $1, $2
|
||||
o "Value OptFuncExist Arguments", -> new CallNode $1, $3, $2
|
||||
o "Invocation OptFuncExist Arguments", -> new CallNode $1, $3, $2
|
||||
]
|
||||
|
||||
# An optional existence check on a function.
|
||||
OptFuncExist: [
|
||||
o "", -> no
|
||||
o "FUNC_EXIST", -> yes
|
||||
]
|
||||
|
||||
# The list of arguments to a function call.
|
||||
Arguments: [
|
||||
o "CALL_START ArgList OptComma CALL_END", -> $2
|
||||
o "FUNC_EXIST CALL_START ArgList OptComma CALL_END", -> $3
|
||||
]
|
||||
|
||||
# Calling super.
|
||||
|
||||
Reference in New Issue
Block a user