Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 7df91826412b0ffb88e291ca2fa2021294fd8de0 1 parent 8f92691
@RJacksonm1 RJacksonm1 authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  tokenizer.js
View
3  tokenizer.js
@@ -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 --');
Please sign in to comment.
Something went wrong with that request. Please try again.