Enchancing pattern matching with @vars ... issue #721

This commit is contained in:
Jeremy Ashkenas
2010-10-04 22:10:10 -04:00
parent 8eb283df2c
commit d1bca6364a
7 changed files with 220 additions and 175 deletions

View File

@@ -149,6 +149,7 @@ grammar =
AssignObj: [
o "Identifier", -> new ValueNode $1
o "AlphaNumeric"
o "ThisProperty"
o "Identifier : Expression", -> new AssignNode new ValueNode($1), $3, 'object'
o "AlphaNumeric : Expression", -> new AssignNode new ValueNode($1), $3, 'object'
o "Identifier : INDENT Expression OUTDENT", -> new AssignNode new ValueNode($1), $4, 'object'
@@ -340,7 +341,7 @@ grammar =
# A reference to a property on *this*.
ThisProperty: [
o "@ Identifier", -> new ValueNode new LiteralNode('this'), [new AccessorNode($2)]
o "@ Identifier", -> new ValueNode new LiteralNode('this'), [new AccessorNode($2)], 'this'
]
# The CoffeeScript range literal.