mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
Added some inline docs
This commit is contained in:
@@ -327,7 +327,8 @@
|
||||
}
|
||||
return true;
|
||||
};
|
||||
// Some docs
|
||||
// Here we detect the currying operator and change local state in order to
|
||||
// parse subsequent tokens accordingly.
|
||||
Lexer.prototype.curry_token = function curry_token() {
|
||||
var _a;
|
||||
if ((typeof (_a = this.currying) !== "undefined" && _a !== null)) {
|
||||
|
||||
@@ -503,6 +503,8 @@
|
||||
return CallNode;
|
||||
}).call(this);
|
||||
//### CurryNode
|
||||
// Node to bind an context and/or some arguments to a function, returning a new function
|
||||
// After `Underscore.bind` from [Underscore](http://documentcloud.github.com/underscore/).
|
||||
exports.CurryNode = (function() {
|
||||
CurryNode = function CurryNode(meth, bind, args) {
|
||||
this.children = flatten([(this.meth = meth), (this.bind = bind || literal('this')), (this.args = (args || []))]);
|
||||
|
||||
@@ -241,7 +241,8 @@ exports.Lexer: class Lexer
|
||||
@tokens.pop() if @value() is "\\"
|
||||
true
|
||||
|
||||
# Some docs
|
||||
# Here we detect the currying operator and change local state in order to
|
||||
# parse subsequent tokens accordingly.
|
||||
curry_token: ->
|
||||
if @currying?
|
||||
if @match(/^\(/, 0) and [',', '<-'].indexOf(@value()) isnt -1
|
||||
|
||||
@@ -386,8 +386,11 @@ exports.CallNode: class CallNode extends BaseNode
|
||||
i += 1
|
||||
args.join('')
|
||||
|
||||
|
||||
#### CurryNode
|
||||
|
||||
# Node to bind an context and/or some arguments to a function, returning a new function
|
||||
# After `Underscore.bind` from [Underscore](http://documentcloud.github.com/underscore/).
|
||||
exports.CurryNode: class CurryNode extends CallNode
|
||||
type: 'Curry'
|
||||
code: '''
|
||||
|
||||
Reference in New Issue
Block a user