Permalink
Browse files

Reset the global vars every time tokenize is called, thereby allowing…

… the module to be used for multiple different strings without prepending previous uses data.
  • Loading branch information...
1 parent 8f92691 commit 7df91826412b0ffb88e291ca2fa2021294fd8de0 @RJacksonm1 RJacksonm1 committed Mar 28, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 tokenizer.js
View
@@ -1,4 +1,3 @@
-var regex_queue = [];
var tokens = [];
var source = '';
var regexQueue = [];
@@ -31,6 +30,8 @@ exports.rule = function (tokenType, re) {
}
exports.tokenize = function (src) {
+ tokens = [];
+ source = '';
source = src;
if (debugFlag) {
console.log('-- Starting tokenizer --');

0 comments on commit 7df9182

Please sign in to comment.