@tslite/parser 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -1
- package/dist/_namespaces/ts.js +15756 -21
- package/dist/diagnosticMessages.generated.js +2969 -1440
- package/dist/factory.d.ts +3 -5
- package/dist/factoryPublic.d.ts +1 -3
- package/dist/types.d.ts +1 -7
- package/dist/utilitiesPublic.d.ts +1 -3
- package/package.json +2 -2
- package/dist/_namespaces/ts.performance.js +0 -2
- package/dist/core.js +0 -1394
- package/dist/corePublic.js +0 -31
- package/dist/debug.js +0 -326
- package/dist/diagnosticInformationMap.generated.js +0 -4
- package/dist/factory.js +0 -622
- package/dist/factoryPublic.js +0 -1796
- package/dist/index.js +0 -4
- package/dist/parser.js +0 -5075
- package/dist/path.js +0 -475
- package/dist/perfLogger.js +0 -38
- package/dist/performance.js +0 -49
- package/dist/performanceTimestamp.js +0 -2
- package/dist/scanner.js +0 -1984
- package/dist/shims/mapShim.js +0 -156
- package/dist/types.js +0 -1074
- package/dist/utilities.js +0 -2632
- package/dist/utilitiesPublic.js +0 -1049
- package/dist/visitor.js +0 -64
- package/dist/visitorPublic.js +0 -352
package/dist/factory.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SyntaxKind } from "./_namespaces/ts.js";
|
|
2
|
-
import type { ArrayBindingOrAssignmentPattern,
|
|
2
|
+
import type { ArrayBindingOrAssignmentPattern, AssignmentPattern, BinaryExpression, BindingOrAssignmentElement, BindingOrAssignmentElementTarget, BindingOrAssignmentPattern, Block, CommaListExpression, ConciseBody, EntityName, Expression, LeftHandSideExpression, Node, NodeArray, ObjectBindingOrAssignmentPattern, ObjectLiteralElementLike, ParenthesizedExpression, PartiallyEmittedExpression, Statement, Token, TransformationContext, TypeNode } from "./_namespaces/ts.js";
|
|
3
3
|
export declare const nullTransformationContext: TransformationContext;
|
|
4
4
|
export declare function createExpressionFromEntityName(node: EntityName | Expression): Expression;
|
|
5
5
|
export declare function convertToFunctionBody(node: ConciseBody, multiLine?: boolean): Block;
|
|
@@ -51,12 +51,10 @@ export declare function isCommaSequence(node: Expression): node is BinaryExpress
|
|
|
51
51
|
} | CommaListExpression;
|
|
52
52
|
export declare enum OuterExpressionKinds {
|
|
53
53
|
Parentheses = 1,
|
|
54
|
-
TypeAssertions = 2,
|
|
55
54
|
PartiallyEmittedExpressions = 8,
|
|
56
|
-
|
|
57
|
-
All = 11
|
|
55
|
+
All = 9
|
|
58
56
|
}
|
|
59
|
-
export type OuterExpression = ParenthesizedExpression |
|
|
57
|
+
export type OuterExpression = ParenthesizedExpression | PartiallyEmittedExpression;
|
|
60
58
|
export declare function isOuterExpression(node: Node, kinds?: OuterExpressionKinds): node is OuterExpression;
|
|
61
59
|
export declare function skipOuterExpressions(node: Expression, kinds?: OuterExpressionKinds): Expression;
|
|
62
60
|
export declare function skipOuterExpressions(node: Node, kinds?: OuterExpressionKinds): Node;
|
package/dist/factoryPublic.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EmitFlags, GeneratedIdentifierFlags, ModifierFlags, NodeFlags, SyntaxKind, TokenFlags } from "./_namespaces/ts.js";
|
|
2
|
-
import type { ArrayBindingElement, ArrayBindingPattern, ArrayLiteralExpression, ArrayTypeNode, ArrowFunction,
|
|
2
|
+
import type { ArrayBindingElement, ArrayBindingPattern, ArrayLiteralExpression, ArrayTypeNode, ArrowFunction, AssertsToken, AwaitExpression, AwaitKeywordToken, BigIntLiteral, BinaryExpression, BinaryOperator, BinaryOperatorToken, BindingElement, BindingName, Block, BooleanLiteral, BreakStatement, Bundle, CallChain, CallExpression, CallSignatureDeclaration, CaseBlock, CaseClause, CaseOrDefaultClause, CatchClause, ColonToken, CommaListExpression, ComputedPropertyName, ConciseBody, ConditionalExpression, ConditionalTypeNode, ContinueStatement, DefaultClause, DeleteExpression, DestructuringAssignment, DoStatement, DotDotDotToken, ElementAccessChain, ElementAccessExpression, EmitHelper, EmitNode, EmptyStatement, EntityName, EqualsGreaterThanToken, ExportAssignment, ExportDeclaration, ExportSpecifier, Expression, ExpressionStatement, ForInStatement, ForInitializer, ForOfStatement, ForStatement, FunctionLikeDeclaration, FunctionTypeNode, GeneratedIdentifier, Identifier, IfStatement, ImportClause, ImportDeclaration, ImportSpecifier, ImportTypeNode, IndexSignatureDeclaration, IndexedAccessTypeNode, InferTypeNode, InputFiles, IntersectionTypeNode, JsxAttribute, JsxAttributeLike, JsxAttributes, JsxChild, JsxClosingElement, JsxClosingFragment, JsxElement, JsxExpression, JsxFragment, JsxText, JsxOpeningElement, JsxOpeningFragment, JsxSelfClosingElement, JsxSpreadAttribute, JsxTagNameExpression, KeywordTypeNode, LiteralTypeNode, MappedTypeNode, MetaProperty, MethodSignature, MinusToken, Modifier, ModuleBlock, ModuleBody, ModuleDeclaration, ModuleName, MutableNodeArray, NamedExportBindings, NamedExports, NamedImportBindings, NamedImports, NamespaceExport, NamespaceImport, NoSubstitutionTemplateLiteral, OmittedExpression, Node, NodeArray, NumericLiteral, ObjectBindingPattern, ObjectLiteralElementLike, ObjectLiteralExpression, OptionalTypeNode, ParameterDeclaration, ParenthesizedExpression, ParenthesizedTypeNode, PartiallyEmittedExpression, PlusToken, PostfixUnaryExpression, PostfixUnaryOperator, PrefixUnaryExpression, PrefixUnaryOperator, PrimaryExpression, PropertyAccessChain, PropertyAccessExpression, PropertyAssignment, PropertyName, PropertySignature, PseudoBigInt, QualifiedName, QuestionDotToken, QuestionToken, ReadonlyToken, RestTypeNode, ReturnStatement, ShorthandPropertyAssignment, SignatureDeclaration, SourceFile, SourceMapRange, SpreadAssignment, SpreadElement, Statement, StringLiteral, SwitchStatement, SynthesizedComment, TemplateExpression, TemplateHead, TemplateMiddle, TemplateSpan, TemplateTail, TextRange, ThrowStatement, Token, TryStatement, TupleTypeNode, TypeAliasDeclaration, TypeElement, TypeLiteralNode, TypeNode, TypeOfExpression, TypeOperatorNode, TypeParameterDeclaration, TypePredicateNode, TypeQueryNode, TypeReferenceNode, UnionTypeNode, UnparsedSource, VariableDeclaration, VariableDeclarationList, VariableStatement, WhileStatement } from "./_namespaces/ts.js";
|
|
3
3
|
export declare function updateNode<T extends Node>(updated: T, original: T): T;
|
|
4
4
|
export declare function createNodeArray<T extends Node>(elements?: T[], hasTrailingComma?: boolean): MutableNodeArray<T>;
|
|
5
5
|
export declare function createNodeArray<T extends Node>(elements?: readonly T[], hasTrailingComma?: boolean): NodeArray<T>;
|
|
@@ -140,8 +140,6 @@ export declare function createNoSubstitutionTemplateLiteral(text: string, rawTex
|
|
|
140
140
|
export declare function createSpread(expression: Expression): SpreadElement;
|
|
141
141
|
export declare function updateSpread(node: SpreadElement, expression: Expression): SpreadElement;
|
|
142
142
|
export declare function createOmittedExpression(): OmittedExpression;
|
|
143
|
-
export declare function createAsExpression(expression: Expression, type: TypeNode): AsExpression;
|
|
144
|
-
export declare function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression;
|
|
145
143
|
export declare function createMetaProperty(keywordToken: MetaProperty["keywordToken"], name: Identifier): MetaProperty;
|
|
146
144
|
export declare function updateMetaProperty(node: MetaProperty, name: Identifier): MetaProperty;
|
|
147
145
|
export declare function createTemplateSpan(expression: Expression, literal: TemplateMiddle | TemplateTail): TemplateSpan;
|
package/dist/types.d.ts
CHANGED
|
@@ -435,7 +435,7 @@ export interface Node extends TextRange {
|
|
|
435
435
|
flowNode?: FlowNode;
|
|
436
436
|
emitNode?: EmitNode;
|
|
437
437
|
}
|
|
438
|
-
export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode |
|
|
438
|
+
export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | TypeAliasDeclaration;
|
|
439
439
|
export type HasTypeArguments = CallExpression | JsxOpeningElement | JsxSelfClosingElement;
|
|
440
440
|
export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
|
|
441
441
|
export type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyAssignment;
|
|
@@ -1043,12 +1043,6 @@ export interface ImportCall extends CallExpression {
|
|
|
1043
1043
|
expression: ImportExpression;
|
|
1044
1044
|
}
|
|
1045
1045
|
export type CallLikeExpression = CallExpression | JsxOpeningLikeElement;
|
|
1046
|
-
export interface AsExpression extends Expression {
|
|
1047
|
-
kind: SyntaxKind.AsExpression;
|
|
1048
|
-
expression: Expression;
|
|
1049
|
-
type: TypeNode;
|
|
1050
|
-
}
|
|
1051
|
-
export type AssertionExpression = AsExpression;
|
|
1052
1046
|
export interface MetaProperty extends PrimaryExpression {
|
|
1053
1047
|
kind: SyntaxKind.MetaProperty;
|
|
1054
1048
|
keywordToken: SyntaxKind.ImportKeyword;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModifierFlags, NodeFlags, SyntaxKind } from "./_namespaces/ts.js";
|
|
2
|
-
import type { ArrayBindingElement, ArrayBindingPattern, ArrayLiteralExpression, ArrayTypeNode, ArrowFunction,
|
|
2
|
+
import type { ArrayBindingElement, ArrayBindingPattern, ArrayLiteralExpression, ArrayTypeNode, ArrowFunction, AssignmentPattern, AwaitExpression, BigIntLiteral, BinaryExpression, BindingElement, BindingName, BindingOrAssignmentElement, BindingPattern, Block, BreakOrContinueStatement, CallChain, CallExpression, CallLikeExpression, CallSignatureDeclaration, CaseBlock, CaseClause, CaseOrDefaultClause, CatchClause, CompilerOptions, ComputedPropertyName, ConciseBody, ConditionalTypeNode, Declaration, DeclarationName, DeclarationWithTypeParameters, DefaultClause, DeleteExpression, Diagnostic, ElementAccessChain, ElementAccessExpression, EmptyStatement, EntityName, ExportAssignment, ExportDeclaration, ExportSpecifier, Expression, ExpressionStatement, ForInOrOfStatement, ForInStatement, ForInitializer, ForOfStatement, FunctionLikeDeclaration, FunctionTypeNode, GeneratedIdentifier, HasInitializer, HasType, Identifier, IfStatement, ImportClause, ImportDeclaration, ImportSpecifier, ImportTypeNode, IndexSignatureDeclaration, IndexedAccessTypeNode, InferTypeNode, IterationStatement, JsxAttribute, JsxAttributeLike, JsxAttributes, JsxChild, JsxClosingElement, JsxClosingFragment, JsxElement, JsxExpression, JsxOpeningElement, JsxOpeningFragment, JsxOpeningLikeElement, JsxSelfClosingElement, JsxSpreadAttribute, JsxTagNameExpression, JsxText, LeftHandSideExpression, LiteralExpression, LiteralTypeNode, MappedTypeNode, MetaProperty, MethodSignature, Modifier, ModuleBlock, ModuleBody, ModuleDeclaration, NamedDeclaration, NamedExportBindings, NamedExports, NamedImportBindings, NamedImports, NamespaceExport, NamespaceImport, NoSubstitutionTemplateLiteral, Node, NodeArray, NotEmittedStatement, NumericLiteral, ObjectBindingPattern, ObjectLiteralElement, ObjectLiteralElementLike, ObjectLiteralExpression, OmittedExpression, OptionalChain, OptionalChainRoot, ParameterDeclaration, ParenthesizedExpression, ParenthesizedTypeNode, PostfixUnaryExpression, PrefixUnaryExpression, PropertyAccessChain, PropertyAccessExpression, PropertyAssignment, PropertyName, PropertySignature, QualifiedName, ReturnStatement, ShorthandPropertyAssignment, SignatureDeclaration, SortedReadonlyArray, SourceFile, SpreadAssignment, SpreadElement, Statement, StringLiteral, StringLiteralLike, SwitchStatement, Symbol, SyntaxList, TemplateHead, TemplateLiteral, TemplateMiddle, TemplateSpan, TemplateTail, TextChangeRange, TextSpan, ThrowStatement, TryStatement, TypeAliasDeclaration, TypeElement, TypeLiteralNode, TypeNode, TypeOfExpression, TypeOnlyCompatibleAliasDeclaration, TypeOperatorNode, TypeParameterDeclaration, TypePredicateNode, TypeQueryNode, TypeReferenceNode, UnaryExpression, UnionTypeNode, UnparsedNode, UnparsedPrepend, UnparsedSource, UnparsedTextLike, VariableDeclaration, VariableDeclarationList, VariableStatement, __String } from "./_namespaces/ts.js";
|
|
3
3
|
export declare function isExternalModuleNameRelative(moduleName: string): boolean;
|
|
4
4
|
export declare function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics: readonly T[]): SortedReadonlyArray<T>;
|
|
5
5
|
export declare function getDefaultLibFileName(options: CompilerOptions): string;
|
|
@@ -137,7 +137,6 @@ export declare function isPrefixUnaryExpression(node: Node): node is PrefixUnary
|
|
|
137
137
|
export declare function isBinaryExpression(node: Node): node is BinaryExpression;
|
|
138
138
|
export declare function isSpreadElement(node: Node): node is SpreadElement;
|
|
139
139
|
export declare function isOmittedExpression(node: Node): node is OmittedExpression;
|
|
140
|
-
export declare function isAsExpression(node: Node): node is AsExpression;
|
|
141
140
|
export declare function isMetaProperty(node: Node): node is MetaProperty;
|
|
142
141
|
export declare function isTemplateSpan(node: Node): node is TemplateSpan;
|
|
143
142
|
export declare function isBlock(node: Node): node is Block;
|
|
@@ -246,7 +245,6 @@ export declare function isUnaryExpressionWithWrite(expr: Node): expr is PrefixUn
|
|
|
246
245
|
* Use `isExpressionNode` if not in transforms.
|
|
247
246
|
*/
|
|
248
247
|
export declare function isExpression(node: Node): node is Expression;
|
|
249
|
-
export declare function isAssertionExpression(node: Node): node is AssertionExpression;
|
|
250
248
|
export declare function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
|
|
251
249
|
export declare function isIterationStatement(node: Node): node is IterationStatement;
|
|
252
250
|
export declare function isForInOrOfStatement(node: Node): node is ForInOrOfStatement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tslite/parser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "The tsc 3.9.10 parse tree, copied from the tag and cut down to the TSLite Language: the tree model, the scanner, the parser and the tree vocabulary",
|
|
5
5
|
"author": "Anderson D. Rosa <andersondrosa@outlook.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "rm -rf dist && tsc -p tsconfig.build.json && node ../../scripts/copy-declarations.mjs dist",
|
|
32
|
+
"build": "rm -rf dist && tsup && tsc -p tsconfig.build.json --emitDeclarationOnly && node ../../scripts/copy-declarations.mjs dist",
|
|
33
33
|
"clean": "rm -rf dist",
|
|
34
34
|
"test": "vitest run",
|
|
35
35
|
"typecheck": "tsc --noEmit -p ."
|