Giter VIP home page Giter VIP logo

Comments (5)

MaceWindu avatar MaceWindu commented on July 21, 2024

Another case:

var match = text.match(/^(\s*)([^]*\S)(\s*)$/); 

postcss-safe-parser\lib\safe-parser.js
safe-parser.zip

from esprima-dotnet.

MaceWindu avatar MaceWindu commented on July 21, 2024
var regex = /{[^]*/gm,

specificity\specificity.js
specificity.zip

from esprima-dotnet.

MaceWindu avatar MaceWindu commented on July 21, 2024
const pathToArgumentName = input => {
		return input
			.replace(/\./g, "-")
			.replace(/\[\]/g, "")
			.replace(
				/(\p{Uppercase_Letter}+|\p{Lowercase_Letter}|\d)(\p{Uppercase_Letter}+)/gu,
				"$1-$2"
			)
			.replace(/-?[^\p{Uppercase_Letter}\p{Lowercase_Letter}\d]+/gu, "-")
			.toLowerCase();
	}; 

webpack\lib\cli.js
cli.zip

from esprima-dotnet.

jimbo118 avatar jimbo118 commented on July 21, 2024

I also ran into this:

var parser = new Esprima.JavaScriptParser(@"var O = /[^]*? (:[rp] [el] a[\w -]+)[^]*/");
var program = parser.ParseScript();

Throw:

ParserException: Line 1: Invalid regular expression
Esprima.Scanner.ThrowUnexpectedToken (System.String message) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.Scanner.TestRegExp (System.String pattern, System.String flags) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.Scanner.ScanRegExp () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.NextRegexToken () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParsePrimaryExpression () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.InheritCoverGrammar[T] (System.Func`1[TResult] parseFunction) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseLeftHandSideExpressionAllowCall () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.InheritCoverGrammar[T] (System.Func`1[TResult] parseFunction) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseUpdateExpression () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseUnaryExpression () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.InheritCoverGrammar[T] (System.Func`1[TResult] parseFunction) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseExponentiationExpression () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.InheritCoverGrammar[T] (System.Func`1[TResult] parseFunction) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseBinaryExpression () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.InheritCoverGrammar[T] (System.Func`1[TResult] parseFunction) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseConditionalExpression () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseAssignmentExpression () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.IsolateCoverGrammar[T] (System.Func`1[TResult] parseFunction) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseVariableDeclaration (System.Boolean& inFor) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseVariableDeclarationList (System.Boolean& inFor) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseVariableStatement () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseStatement () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseStatementListItem () (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)
Esprima.JavaScriptParser.ParseScript (System.Boolean strict) (at <8417cb4e01e54c02aaa0c58a3fa07237>:0)

But it's valid on the Esprima online parserpage:

Esprima Online Parser

from esprima-dotnet.

sebastienros avatar sebastienros commented on July 21, 2024

I was able to isolate the issue for all these reports to /[^]/. Working on the fix.

from esprima-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.