(experimental) made new a unary operator

This commit is contained in:
satyr
2010-09-25 17:39:19 +09:00
parent 9a3b736174
commit c24e1eacb9
10 changed files with 32 additions and 42 deletions

View File

@@ -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']