Skip to content

Commit

Permalink
Hardened debug log of scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed Oct 27, 2011
1 parent 33408e2 commit a7fb883
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/js-yaml/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ exports.Scanner = new JS.Class('Scanner', {
},

getToken: function () {
var token = null;

// Return the next token.

debug('scanner#getToken -- start');
Expand All @@ -211,10 +213,14 @@ exports.Scanner = new JS.Class('Scanner', {

if (this.tokens.length) {
this.tokensTaken += 1;
return this.tokens.shift();
token = this.tokens.shift();

if (debug.ENABLED) {
debug('scanner#getToken -- got token', {token: token});
}
}

return null;
return token;
},

needMoreTokens: function () {
Expand Down

0 comments on commit a7fb883

Please sign in to comment.