Added some inline docs

This commit is contained in:
matehat
2010-03-17 03:20:06 -04:00
parent 8d098194dd
commit 5be437deb9
4 changed files with 9 additions and 2 deletions

View File

@@ -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)) {

View File

@@ -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 || []))]);

View File

@@ -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

View File

@@ -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: '''