🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

peggy

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

peggy - npm Package Compare versions

Comparing version
5.0.0
to
5.0.1
+1
-1
bin/peggy-cli.js

@@ -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));

@@ -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,

@@ -6,2 +6,2 @@ // Generated by package-extract v3.1.0

exports.version = "5.0.0";
exports.version = "5.0.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