regjsparser
Advanced tools
Comparing version 0.6.3 to 0.6.4
{ | ||
"name": "regjsparser", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"author": "'Julian Viereck' <julian.viereck@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "BSD-2-Clause", |
@@ -236,8 +236,2 @@ // regjsparser | ||
if (hasUnicodeFlag) { | ||
if (_char === '}') { | ||
bail("unescaped or unmatched closing brace"); | ||
} | ||
if (_char === ']') { | ||
bail("unescaped or unmatched closing bracket"); | ||
} | ||
var second; | ||
@@ -491,3 +485,3 @@ if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) { | ||
var atom = parseAtom(); | ||
var atom = parseAtomAndExtendedAtom(); | ||
if (!atom) { | ||
@@ -616,3 +610,8 @@ bail('Expected atom'); | ||
function parseAtom() { | ||
function parseAtomAndExtendedAtom() { | ||
// Parsing Atom and ExtendedAtom together due to redundancy. | ||
// ExtendedAtom is defined in Apendix B of the ECMA-262 standard. | ||
// | ||
// SEE: https://www.ecma-international.org/ecma-262/10.0/index.html#prod-annexB-ExtendedPatternCharacter | ||
// | ||
// Atom :: | ||
@@ -625,2 +624,6 @@ // PatternCharacter | ||
// ( ? : Disjunction ) | ||
// ExtendedAtom :: | ||
// ExtendedPatternCharacter | ||
// ExtendedPatternCharacter :: | ||
// SourceCharacter but not one of ^$\.*+?()[| | ||
@@ -631,7 +634,10 @@ var res; | ||
// implementations: ']'.match(/]/); | ||
// if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) { | ||
if (res = matchReg(/^[^^$\\.*+?(){[|]/)) { | ||
if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) { | ||
// PatternCharacter | ||
return createCharacter(res); | ||
} | ||
else if (!hasUnicodeFlag && (res = matchReg(/^(?:]|})/))) { | ||
// ExtendedPatternCharacter | ||
return createCharacter(res); | ||
} | ||
else if (match('.')) { | ||
@@ -638,0 +644,0 @@ // . |
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
49558
1107