mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
removed all traces of 'extends' -- it's not any shorter or more convenient than just setting the prototype
This commit is contained in:
@@ -229,7 +229,7 @@
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(super|this|extends)\b</string>
|
||||
<string>\b(super|this)\b</string>
|
||||
<key>name</key>
|
||||
<string>variable.language.cs</string>
|
||||
</dict>
|
||||
|
||||
@@ -10,7 +10,7 @@ token TRY CATCH FINALLY THROW
|
||||
token BREAK CONTINUE
|
||||
token FOR IN WHILE
|
||||
token SWITCH CASE
|
||||
token EXTENDS SUPER
|
||||
token SUPER
|
||||
token DELETE
|
||||
token NEWLINE
|
||||
token COMMENT
|
||||
@@ -30,7 +30,7 @@ prechigh
|
||||
right DELETE
|
||||
left "."
|
||||
right THROW FOR IN WHILE NEW
|
||||
left UNLESS IF ELSE EXTENDS
|
||||
left UNLESS IF ELSE
|
||||
left ":"
|
||||
right RETURN
|
||||
preclow
|
||||
@@ -69,7 +69,6 @@ rule
|
||||
| Call
|
||||
| Code
|
||||
| Operation
|
||||
| Extend
|
||||
;
|
||||
|
||||
# We have to take extra care to convert these statements into expressions.
|
||||
@@ -255,11 +254,6 @@ rule
|
||||
SUPER "(" ArgList ")" { result = CallNode.new(:super, val[2]) }
|
||||
;
|
||||
|
||||
# Extending a class.
|
||||
Extend:
|
||||
IDENTIFIER EXTENDS Expression { result = ExtendNode.new(val[0], val[2]) }
|
||||
;
|
||||
|
||||
# The array literal.
|
||||
Array:
|
||||
"[" ArgList "]" { result = ArrayNode.new(val[1]) }
|
||||
|
||||
@@ -14,7 +14,7 @@ module CoffeeScript
|
||||
"break", "continue",
|
||||
"for", "in", "while",
|
||||
"switch", "case",
|
||||
"extends", "super",
|
||||
"super",
|
||||
"delete"]
|
||||
|
||||
# Token matching regexes.
|
||||
|
||||
@@ -213,21 +213,6 @@ module CoffeeScript
|
||||
end
|
||||
end
|
||||
|
||||
class ExtendNode < Node
|
||||
|
||||
attr_reader :subclass, :superclass
|
||||
|
||||
def initialize(subclass, superclass)
|
||||
@subclass, @superclass = subclass, superclass
|
||||
end
|
||||
|
||||
def compile(o={})
|
||||
o = super(o)
|
||||
"#{@subclass}.prototype = #{@superclass.compile(o)}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# A value, indexed or dotted into, or vanilla.
|
||||
class ValueNode < Node
|
||||
attr_reader :literal, :properties, :last
|
||||
|
||||
Reference in New Issue
Block a user