Skip to content

Commit

Permalink
Merge pull request #63 from mekwall/patch-1
Browse files Browse the repository at this point in the history
Fixed misspell, withinSignle => withinSingle
  • Loading branch information
tj committed Jul 24, 2012
2 parents 1b9e8d0 + 5cd46e0 commit d8b3e37
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/dox.js
Expand Up @@ -31,12 +31,12 @@ exports.parseComments = function(js, options){
, buf = '' , buf = ''
, ignore , ignore
, withinMultiline = false , withinMultiline = false
, withinSignle = false , withinSingle = false
, code; , code;


for (var i = 0, len = js.length; i < len; ++i) { for (var i = 0, len = js.length; i < len; ++i) {
// start comment // start comment
if (!withinMultiline && !withinSignle && '/' == js[i] && '*' == js[i+1]) { if (!withinMultiline && !withinSingle && '/' == js[i] && '*' == js[i+1]) {
// code following previous comment // code following previous comment
if (buf.trim().length) { if (buf.trim().length) {
comment = comments[comments.length - 1]; comment = comments[comments.length - 1];
Expand All @@ -50,20 +50,20 @@ exports.parseComments = function(js, options){
withinMultiline = true; withinMultiline = true;
ignore = '!' == js[i]; ignore = '!' == js[i];
// end comment // end comment
} else if (withinMultiline && !withinSignle && '*' == js[i] && '/' == js[i+1]) { } else if (withinMultiline && !withinSingle && '*' == js[i] && '/' == js[i+1]) {
i += 2; i += 2;
buf = buf.replace(/^ *\* ?/gm, ''); buf = buf.replace(/^ *\* ?/gm, '');
var comment = exports.parseComment(buf, options); var comment = exports.parseComment(buf, options);
comment.ignore = ignore; comment.ignore = ignore;
comments.push(comment); comments.push(comment);
withinMultiline = ignore = false; withinMultiline = ignore = false;
buf = ''; buf = '';
} else if (!withinSignle && !withinMultiline && '/' == js[i] && '/' == js[i+1]) { } else if (!withinSingle && !withinMultiline && '/' == js[i] && '/' == js[i+1]) {
i += 2; i += 2;
withinSignle = true; withinSingle = true;
buf += js[i]; buf += js[i];
} else if (withinSignle && !withinMultiline && '\n' == js[i]) { } else if (withinSingle && !withinMultiline && '\n' == js[i]) {
withinSignle = false; withinSingle = false;
buf += js[i]; buf += js[i];
// buffer comment or code // buffer comment or code
} else { } else {
Expand Down

0 comments on commit d8b3e37

Please sign in to comment.