This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ get a: -> @a } | |
{ | |
get a: function a() { | |
return this.a; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/grammar.coffee b/src/grammar.coffee | |
index 81d5b04..69df6d8 100644 | |
--- a/src/grammar.coffee | |
+++ b/src/grammar.coffee | |
@@ -135,12 +135,25 @@ grammar: { | |
o "Assignable ASSIGN Expression", -> new AssignNode $1, $3 | |
] | |
- # Assignment when it happens within an object literal. The difference from | |
- # the ordinary **Assign** is that these allow numbers and strings as keys. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj: { | |
i_am_a_named_fn: -> yes | |
i_still_have_a_name: -> (yes) | |
i_have_no_name: (-> yes) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template recoverable: -> | |
args: arguments[0].flatten() | |
"${args[0].value}: ${ utility 'recoverable' } <- ${args[0].value}" | |
my_async_fn: (err, result) -> | |
.. code here .. | |
recoverable my_async_fn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[left: right]: bag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/rewriter.coffee b/src/rewriter.coffee | |
index ec07bd4..6210088 100644 | |
--- a/src/rewriter.coffee | |
+++ b/src/rewriter.coffee | |
@@ -54,10 +54,14 @@ exports.Rewriter: class Rewriter | |
adjust_comments: -> | |
@scan_tokens (prev, token, post, i) => | |
return 1 unless token[0] is 'COMMENT' | |
+ before: @tokens[i - 2] | |
after: @tokens[i + 2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/lexer.coffee b/src/lexer.coffee | |
index 1fba057..59c0595 100644 | |
--- a/src/lexer.coffee | |
+++ b/src/lexer.coffee | |
@@ -199,7 +199,7 @@ exports.Lexer: class Lexer | |
prev: @prev(2) | |
size: indent.match(LAST_DENTS).reverse()[0].match(LAST_DENT)[1].length | |
next_character: @chunk.match(MULTI_DENT)[4] | |
- no_newlines: next_character is '.' or @unfinished() | |
+ no_newlines: next_character is '.' or next_character is '+' or @unfinished() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is at the start of the current Lexer. | |
# Import the helpers we need. | |
helpers: require('./helpers').helpers | |
include: helpers.include | |
count: helpers.count | |
starts: helpers.starts | |
compact: helpers.compact | |
balanced_string: helpers.balanced_string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!(cond)) { | |
expression; | |
} | |
vs. | |
if ( ! (cond)) { | |
expression; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj: { | |
_value: [] | |
get value: -> @_value | |
set value: (val) -> @_value: val | |
one: (n) -> n.concat [n[-1] + 1] | |
two: (n) -> n.concat [n[-1] + 2] | |
} |