@ts-graphviz/ast
Advanced tools
Comparing version 2.0.6 to 2.0.7-next-c043ba9bcc5194a89b976df1609c4e9875300f1e
# @ts-graphviz/ast | ||
## 2.0.7-next-c043ba9bcc5194a89b976df1609c4e9875300f1e | ||
### Patch Changes | ||
- [#1318](https://github.com/ts-graphviz/ts-graphviz/pull/1318) [`c043ba9`](https://github.com/ts-graphviz/ts-graphviz/commit/c043ba9bcc5194a89b976df1609c4e9875300f1e) Thanks [@kamiazya](https://github.com/kamiazya)! - Improve error handling and documentation in the @ts-graphviz/ast package. | ||
The most important changes include fixing an unexpected parsing error, updating the error class used in the parse function, and enhancing the documentation for the `DotSyntaxError` class. | ||
## 2.0.6 | ||
@@ -4,0 +12,0 @@ |
@@ -11,6 +11,2 @@ import { ASTType } from '@ts-graphviz/common'; | ||
declare interface AnyExpectation { | ||
type: "any"; | ||
} | ||
/** | ||
@@ -153,12 +149,2 @@ * ASTBaseNode is an interface that serves as the base for all AST nodes. | ||
declare interface ClassExpectation { | ||
type: "class"; | ||
parts: ClassParts; | ||
inverted: boolean; | ||
ignoreCase: boolean; | ||
} | ||
declare interface ClassParts extends Array<string | ClassParts> { | ||
} | ||
/** | ||
@@ -399,6 +385,15 @@ * ClusterStatementASTNode is a type used to represent a statement in a cluster graph. | ||
/** | ||
* DotSyntaxError is a class that extends the SyntaxError class and provides additional information about the syntax error. | ||
* | ||
* @group Convert DOT to AST | ||
* | ||
* @remarks | ||
* This error is thrown when a parsing error occurs. | ||
* The error provides additional information about the syntax error. | ||
* | ||
* This is in reference to the specification | ||
* that the error thrown when a parse error occurs in the {@link !JSON.parse} function is {@link !SyntaxError}. | ||
*/ | ||
export declare class DotSyntaxError extends PeggySyntaxError { | ||
constructor(...args: ConstructorParameters<typeof PeggySyntaxError>); | ||
export declare class DotSyntaxError extends SyntaxError { | ||
constructor(...args: ConstructorParameters<typeof SyntaxError>); | ||
} | ||
@@ -437,6 +432,2 @@ | ||
declare interface EndExpectation { | ||
type: "end"; | ||
} | ||
/** | ||
@@ -448,4 +439,2 @@ * This type represents the EndOfLine type which is used to determine the type of line ending to be used when writing to a file. | ||
declare type Expectation = LiteralExpectation | ClassExpectation | AnyExpectation | EndExpectation | OtherExpectation; | ||
/** | ||
@@ -471,8 +460,2 @@ * The FilePosition interface represents the position of a file in terms of its offset, line number, and column number. | ||
declare interface FilePosition_2 { | ||
offset: number; | ||
line: number; | ||
column: number; | ||
} | ||
/** | ||
@@ -493,8 +476,2 @@ * FileRange interface represents a range of positions within a file. | ||
declare interface FileRange_2 { | ||
start: FilePosition_2; | ||
end: FilePosition_2; | ||
source: string; | ||
} | ||
/** | ||
@@ -589,8 +566,2 @@ * A function used to convert a DotObjectModel into an AST. | ||
declare interface LiteralExpectation { | ||
type: "literal"; | ||
text: string; | ||
ignoreCase: boolean; | ||
} | ||
/** | ||
@@ -671,7 +642,2 @@ * ModelOf is a type that determines the type of model to use depending on the value of T. | ||
declare interface OtherExpectation { | ||
type: "other"; | ||
description: string; | ||
} | ||
/** | ||
@@ -694,3 +660,3 @@ * parse is a function that takes a string input and optional parse options and | ||
* | ||
* @throws {@link SyntaxError} | ||
* @throws {@link DotSyntaxError} | ||
* @group Convert DOT to AST | ||
@@ -727,20 +693,2 @@ */ | ||
declare const PeggySyntaxError: typeof _PeggySyntaxError; | ||
declare type PeggySyntaxError = _PeggySyntaxError; | ||
declare class _PeggySyntaxError extends Error { | ||
static buildMessage(expected: Expectation[], found: string | null): string; | ||
message: string; | ||
expected: Expectation[]; | ||
found: string | null; | ||
location: FileRange_2; | ||
name: string; | ||
constructor(message: string, expected: Expectation[], found: string | null, location: FileRange_2); | ||
format(sources: { | ||
source?: any; | ||
text: string; | ||
}[]): string; | ||
} | ||
/** | ||
@@ -747,0 +695,0 @@ * PrintContext interface provides an interface for printing an ASTNode with a set of options. |
{ | ||
"name": "@ts-graphviz/ast", | ||
"version": "2.0.6", | ||
"version": "2.0.7-next-c043ba9bcc5194a89b976df1609c4e9875300f1e", | ||
"description": "Graphviz AST(Abstract Syntax Tree) Utilities", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
324191
283643
8305
1