From 5be437deb95b0ccf9ce0708eb24b9e8b21eae3ce Mon Sep 17 00:00:00 2001 From: matehat Date: Wed, 17 Mar 2010 03:20:06 -0400 Subject: [PATCH] Added some inline docs --- lib/lexer.js | 3 ++- lib/nodes.js | 2 ++ src/lexer.coffee | 3 ++- src/nodes.coffee | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/lexer.js b/lib/lexer.js index 780c3a2a..f170a14a 100644 --- a/lib/lexer.js +++ b/lib/lexer.js @@ -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)) { diff --git a/lib/nodes.js b/lib/nodes.js index 930876a8..29831b5f 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -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 || []))]); diff --git a/src/lexer.coffee b/src/lexer.coffee index 4b4e839d..0bd2c592 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -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 diff --git a/src/nodes.coffee b/src/nodes.coffee index cbcdd859..f574e3c3 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -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: '''