adding passed-through block comments back to the grammar/lexer/rewriter/nodes ... thanks, Trevor Burnham.

This commit is contained in:
Jeremy Ashkenas
2010-07-01 21:26:33 -04:00
parent 364ec2a694
commit 77a75ed365
10 changed files with 384 additions and 213 deletions

View File

@@ -99,6 +99,7 @@ grammar: {
o "Class"
o "Splat"
o "Existence"
o "Comment"
]
# A an indented block of expressions. Note that the [Rewriter](rewriter.html)
@@ -107,6 +108,7 @@ grammar: {
Block: [
o "INDENT Body OUTDENT", -> $2
o "INDENT OUTDENT", -> new Expressions
o "TERMINATOR Comment", -> Expressions.wrap [$2]
]
# A literal identifier, a variable name or property.
@@ -147,6 +149,7 @@ grammar: {
o "AlphaNumeric"
o "Identifier ASSIGN Expression", -> new AssignNode new ValueNode($1), $3, 'object'
o "AlphaNumeric ASSIGN Expression", -> new AssignNode new ValueNode($1), $3, 'object'
o "Comment"
]
# A return statement from a function body.
@@ -155,6 +158,11 @@ grammar: {
o "RETURN", -> new ReturnNode new ValueNode new LiteralNode 'null'
]
# A block comment.
Comment: [
o "HERECOMMENT", -> new CommentNode $1
]
# [The existential operator](http://jashkenas.github.com/coffee-script/#existence).
Existence: [
o "Expression ?", -> new ExistenceNode $1