mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-17 19:11:22 -05:00
(experimental) made new a unary operator
This commit is contained in:
@@ -88,7 +88,6 @@ grammar =
|
||||
# them somewhat circular.
|
||||
Expression: [
|
||||
o "Value"
|
||||
o "Call"
|
||||
o "Code"
|
||||
o "Operation"
|
||||
o "Assign"
|
||||
@@ -298,13 +297,6 @@ grammar =
|
||||
o "{ ClassBody }", -> $2
|
||||
]
|
||||
|
||||
# The two flavors of function call: normal, and object instantiation with `new`.
|
||||
Call: [
|
||||
o "Invocation"
|
||||
o "NEW Invocation", -> $2.newInstance()
|
||||
o "NEW Value", -> (new CallNode($2, [])).newInstance()
|
||||
]
|
||||
|
||||
# Extending an object by setting its prototype chain to reference a parent
|
||||
# object.
|
||||
Extends: [
|
||||
@@ -575,7 +567,7 @@ grammar =
|
||||
#
|
||||
# (2 + 3) * 4
|
||||
operators = [
|
||||
["right", '?', 'NEW']
|
||||
["right", '?']
|
||||
["left", 'CALL_START', 'CALL_END']
|
||||
["nonassoc", '++', '--']
|
||||
["right", 'UNARY']
|
||||
|
||||
Reference in New Issue
Block a user