mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
first draft of parsing and printing along comments -- unfortunately, not yet working within objects and arrays
This commit is contained in:
@@ -13,6 +13,7 @@ token SWITCH CASE
|
||||
token EXTENDS SUPER
|
||||
token DELETE
|
||||
token NEWLINE
|
||||
token COMMENT
|
||||
token JS
|
||||
|
||||
# Declare order of operations.
|
||||
@@ -81,6 +82,7 @@ rule
|
||||
| While
|
||||
| For
|
||||
| Switch
|
||||
| Comment
|
||||
;
|
||||
|
||||
# All tokens that can terminate an expression.
|
||||
@@ -123,6 +125,11 @@ rule
|
||||
RETURN Expression { result = ReturnNode.new(val[1]) }
|
||||
;
|
||||
|
||||
# A comment.
|
||||
Comment:
|
||||
COMMENT { result = CommentNode.new(val[0]) }
|
||||
;
|
||||
|
||||
# Arithmetic and logical operators
|
||||
# For Ruby's Operator precedence, see:
|
||||
# https://www.cs.auckland.ac.nz/references/ruby/ProgrammingRuby/language.html
|
||||
|
||||
Reference in New Issue
Block a user