adding '::' as shorthand for '.prototype.'

This commit is contained in:
Jeremy Ashkenas
2010-01-10 16:16:59 -05:00
parent 902febb43a
commit ad18378f7e
10 changed files with 59 additions and 36 deletions

View File

@@ -4,7 +4,7 @@ class Parser
token IF ELSE UNLESS
token NUMBER STRING REGEX
token TRUE FALSE YES NO ON OFF
token IDENTIFIER PROPERTY_ACCESS
token IDENTIFIER PROPERTY_ACCESS PROTOTYPE_ACCESS
token CODE PARAM NEW RETURN
token TRY CATCH FINALLY THROW
token BREAK CONTINUE
@@ -234,6 +234,7 @@ rule
# Accessing into an object or array, through dot or index notation.
Accessor:
PROPERTY_ACCESS IDENTIFIER { result = AccessorNode.new(val[1]) }
| PROTOTYPE_ACCESS IDENTIFIER { result = AccessorNode.new(val[1], true) }
| Index { result = val[0] }
| Range { result = SliceNode.new(val[0]) }
;