mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
got extends back in the language -- use it together with super
This commit is contained in:
@@ -11,7 +11,7 @@ token BREAK CONTINUE
|
||||
token FOR IN WHILE
|
||||
token SWITCH WHEN
|
||||
token DELETE INSTANCEOF TYPEOF
|
||||
token SUPER
|
||||
token SUPER EXTENDS
|
||||
token NEWLINE
|
||||
token COMMENT
|
||||
token JS
|
||||
@@ -29,8 +29,8 @@ prechigh
|
||||
right '-=' '+=' '/=' '*='
|
||||
right DELETE INSTANCEOF TYPEOF
|
||||
left "."
|
||||
right THROW FOR IN WHILE NEW
|
||||
left UNLESS IF ELSE
|
||||
right THROW FOR IN WHILE NEW SUPER
|
||||
left UNLESS IF ELSE EXTENDS
|
||||
left ":" '||:' '&&:'
|
||||
right RETURN
|
||||
preclow
|
||||
@@ -81,6 +81,7 @@ rule
|
||||
| While
|
||||
| For
|
||||
| Switch
|
||||
| Extends
|
||||
| Comment
|
||||
;
|
||||
|
||||
@@ -254,6 +255,11 @@ rule
|
||||
| Super { result = val[0] }
|
||||
;
|
||||
|
||||
# Extending an object's prototype.
|
||||
Extends:
|
||||
Value EXTENDS Expression { result = ExtendsNode.new(val[0], val[2]) }
|
||||
;
|
||||
|
||||
# A generic function invocation.
|
||||
Invocation:
|
||||
Value "(" ArgList ")" { result = CallNode.new(val[0], val[2]) }
|
||||
|
||||
Reference in New Issue
Block a user