+1
-1
@@ -220,3 +220,3 @@ "use strict"; | ||
| if (opts.error) { | ||
| const er = /** @type {peggy.parser.PeggySyntaxError} */(opts.error); | ||
| const er = /** @type {peggy.parser.SyntaxError} */(opts.error); | ||
| if (typeof er.format === "function") { | ||
@@ -223,0 +223,0 @@ const fmt = er.format(/** @type {peggy.SourceText[]} */(opts.sources)); |
+26
-31
@@ -448,9 +448,9 @@ // Based on PEG.js Type Definitions by: vvakame <https://github.com/vvakame>, Tobias Kahlert <https://github.com/SrTobi>, C.J. Bell <https://github.com/siegebell> | ||
| /** Location where message is generated, if applicable. */ | ||
| location: LocationRange?, | ||
| location?: LocationRange, | ||
| /** List of additional messages with their locations, if applicable. */ | ||
| diagnostics: DiagnosticNote[]?, | ||
| diagnostics?: DiagnosticNote[], | ||
| ]; | ||
| /** Thrown if the grammar contains a semantic error. */ | ||
| export class GrammarError extends SyntaxError { | ||
| export class GrammarError extends globalThis.SyntaxError { | ||
| /** Location of the error in the source. */ | ||
@@ -563,3 +563,3 @@ public location?: LocationRange; | ||
| * | ||
| * @throws {PeggySyntaxError} If `grammar` has an incorrect format | ||
| * @throws {SyntaxError} If `grammar` has an incorrect format | ||
| */ | ||
@@ -640,24 +640,4 @@ function parse(grammar: string, options?: Options): ast.Grammar; | ||
| interface PeggySyntaxErrorConstructor { | ||
| readonly prototype: PeggySyntaxError; | ||
| new ( | ||
| message: string, | ||
| expected: Expectation[] | null, | ||
| found: string | null, | ||
| location: LocationRange | ||
| ): PeggySyntaxError; | ||
| // Static methods | ||
| /** | ||
| * Constructs the human-readable message from the machine representation. | ||
| * | ||
| * @param expected Array of expected items, generated by the parser | ||
| * @param found Any text that will appear as found in the input instead of expected | ||
| */ | ||
| buildMessage(expected: Expectation[], found: string): string; | ||
| } | ||
| /** Thrown if the grammar contains a syntax error. */ | ||
| class PeggySyntaxError extends SyntaxError { | ||
| class SyntaxError extends globalThis.SyntaxError { | ||
| /** Location where error was originated. */ | ||
@@ -678,2 +658,9 @@ public location: LocationRange; | ||
| public constructor( | ||
| message: string, | ||
| expected: Expectation[] | null, | ||
| found: string | null, | ||
| location: LocationRange | ||
| ): SyntaxError; | ||
| /** | ||
@@ -698,2 +685,10 @@ * Format the error with associated sources. The `location.source` should have | ||
| public format(sources: SourceText[]): string; | ||
| /** | ||
| * Constructs the human-readable message from the machine representation. | ||
| * | ||
| * @param expected Array of expected items, generated by the parser | ||
| * @param found Any text that will appear as found in the input instead of expected | ||
| */ | ||
| public static buildMessage(expected: Expectation[], found: string): string; | ||
| } | ||
@@ -1117,3 +1112,3 @@ } | ||
| StartRules: string[]; | ||
| SyntaxError: parser.PeggySyntaxErrorConstructor; | ||
| SyntaxError: typeof parser.SyntaxError; | ||
@@ -1461,3 +1456,3 @@ parse( | ||
| * | ||
| * @throws {PeggySyntaxError} If the grammar contains a syntax error, for example, | ||
| * @throws {SyntaxError} If the grammar contains a syntax error, for example, | ||
| * an unclosed brace | ||
@@ -1479,3 +1474,3 @@ * @throws {GrammarError} If the grammar contains a semantic error, for example, | ||
| * | ||
| * @throws {PeggySyntaxError} If the grammar contains a syntax error, for example, | ||
| * @throws {SyntaxError} If the grammar contains a syntax error, for example, | ||
| * an unclosed brace | ||
@@ -1502,3 +1497,3 @@ * @throws {GrammarError} If the grammar contains a semantic error, for example, | ||
| * | ||
| * @throws {PeggySyntaxError} If the grammar contains a syntax error, for example, | ||
| * @throws {SyntaxError} If the grammar contains a syntax error, for example, | ||
| * an unclosed brace | ||
@@ -1541,3 +1536,3 @@ * @throws {GrammarError} If the grammar contains a semantic error, for | ||
| * | ||
| * @throws {PeggySyntaxError} If the grammar contains a syntax error, for example, | ||
| * @throws {SyntaxError} If the grammar contains a syntax error, for example, | ||
| * an unclosed brace | ||
@@ -1563,3 +1558,3 @@ * @throws {GrammarError} If the grammar contains a semantic error, for example, | ||
| * | ||
| * @throws {PeggySyntaxError} If the grammar contains a syntax error, for example, | ||
| * @throws {SyntaxError} If the grammar contains a syntax error, for example, | ||
| * an unclosed brace | ||
@@ -1566,0 +1561,0 @@ * @throws {GrammarError} If the grammar contains a semantic error, for example, |
+1
-1
@@ -6,2 +6,2 @@ // Generated by package-extract v3.1.0 | ||
| exports.version = "5.0.0"; | ||
| exports.version = "5.0.1"; |
+1
-1
| { | ||
| "name": "peggy", | ||
| "version": "5.0.0", | ||
| "version": "5.0.1", | ||
| "description": "Parser generator for JavaScript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
482097
-0.02%12053
-0.03%