regexp-parser
Advanced tools
Comparing version 0.1.2 to 0.1.3
'use strict'; | ||
var State = require('./state'); | ||
var util = require('./util'); | ||
var debug = require('debug')('regex-parser'); | ||
const State = require('./state'); | ||
const util = require('./util'); | ||
const debug = require('debug')('regex-parser'); | ||
const | ||
const CONCAT_CHAR = String.fromCharCode(8); | ||
var CONCAT_CHAR = String.fromCharCode(8); | ||
module.exports = Parser; | ||
@@ -43,5 +43,4 @@ | ||
var i, len, c; | ||
for (i = 0, len = pattern.length; i < len; ++i) { | ||
c = pattern.charAt(i); | ||
for (let i = 0, len = pattern.length; i < len; ++i) { | ||
let c = pattern.charAt(i); | ||
@@ -134,3 +133,3 @@ if (isInput(c)) { | ||
var operator = this.operatorStack.pop(); | ||
const operator = this.operatorStack.pop(); | ||
@@ -161,4 +160,4 @@ // Check which operator it is | ||
// pop 2 elements | ||
var B = this._pop(); | ||
var A = this._pop(); | ||
let B = this._pop(); | ||
let A = this._pop(); | ||
if (!A || !B) return false; | ||
@@ -179,4 +178,4 @@ | ||
Parser.prototype._push = function (input) { | ||
var start = new State(); | ||
var end = new State(); | ||
let start = new State(); | ||
let end = new State(); | ||
start.addTransition(input, end); | ||
@@ -300,5 +299,5 @@ | ||
} | ||
} | ||
} | ||
return res; | ||
return res; | ||
}; | ||
@@ -341,7 +340,6 @@ | ||
function concatExpand(str) { | ||
var ret = ''; | ||
var i, len, cLeft, cRight; | ||
for (i = 0, len = str.length; i < len - 1; i++) { | ||
cLeft = str[i]; | ||
cRight = str[i + 1]; | ||
let ret = ''; | ||
for (let i = 0, len = str.length; i < len - 1; i++) { | ||
let cLeft = str[i]; | ||
let cRight = str[i + 1]; | ||
ret += cLeft; | ||
@@ -348,0 +346,0 @@ if (isInput(cLeft) || isRightParanthesis(cLeft) || cLeft === '*') { |
{ | ||
"name": "regexp-parser", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "an elegant regular expression parser purely implemented in javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48505
379