@tslite/parser 1.16.1 → 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.
@@ -2923,7 +2923,6 @@ function tokenIsIdentifierOrKeywordOrGreaterThan(token) {
2923
2923
  return token === 31 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token);
2924
2924
  }
2925
2925
  var textToKeywordObj = {
2926
- any: 125 /* AnyKeyword */,
2927
2926
  as: 123 /* AsKeyword */,
2928
2927
  asserts: 124 /* AssertsKeyword */,
2929
2928
  bigint: 151 /* BigIntKeyword */,
@@ -3079,6 +3078,7 @@ function makeReverseMap(source) {
3079
3078
  return result;
3080
3079
  }
3081
3080
  var tokenStrings = makeReverseMap(textToToken);
3081
+ tokenStrings[125 /* AnyKeyword */] = "any";
3082
3082
  function tokenToString(t) {
3083
3083
  return tokenStrings[t];
3084
3084
  }
@@ -5122,9 +5122,6 @@ function isSpreadElement(node) {
5122
5122
  function isOmittedExpression(node) {
5123
5123
  return node.kind === 215 /* OmittedExpression */;
5124
5124
  }
5125
- function isAsExpression(node) {
5126
- return node.kind === 217 /* AsExpression */;
5127
- }
5128
5125
  function isMetaProperty(node) {
5129
5126
  return node.kind === 219 /* MetaProperty */;
5130
5127
  }
@@ -5511,7 +5508,6 @@ function isExpressionKind(kind) {
5511
5508
  case 202 /* ArrowFunction */:
5512
5509
  case 209 /* BinaryExpression */:
5513
5510
  case 213 /* SpreadElement */:
5514
- case 217 /* AsExpression */:
5515
5511
  case 215 /* OmittedExpression */:
5516
5512
  case 327 /* CommaListExpression */:
5517
5513
  case 326 /* PartiallyEmittedExpression */:
@@ -5520,10 +5516,6 @@ function isExpressionKind(kind) {
5520
5516
  return isUnaryExpressionKind(kind);
5521
5517
  }
5522
5518
  }
5523
- function isAssertionExpression(node) {
5524
- const kind = node.kind;
5525
- return kind === 217 /* AsExpression */;
5526
- }
5527
5519
  function isNotEmittedStatement(node) {
5528
5520
  return node.kind === 325 /* NotEmittedStatement */;
5529
5521
  }
@@ -6280,7 +6272,6 @@ function isExpressionNode(node) {
6280
6272
  case 194 /* PropertyAccessExpression */:
6281
6273
  case 195 /* ElementAccessExpression */:
6282
6274
  case 196 /* CallExpression */:
6283
- case 217 /* AsExpression */:
6284
6275
  case 200 /* ParenthesizedExpression */:
6285
6276
  case 202 /* ArrowFunction */:
6286
6277
  case 203 /* DeleteExpression */:
@@ -6342,8 +6333,6 @@ function isInExpressionContext(node) {
6342
6333
  case 232 /* ForOfStatement */:
6343
6334
  const forInStatement = parent;
6344
6335
  return forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */ || forInStatement.expression === node;
6345
- case 217 /* AsExpression */:
6346
- return node === parent.expression;
6347
6336
  case 221 /* TemplateSpan */:
6348
6337
  return node === parent.expression;
6349
6338
  case 154 /* ComputedPropertyName */:
@@ -7039,8 +7028,8 @@ function getBinaryOperatorPrecedence(kind) {
7039
7028
  case 31 /* GreaterThanToken */:
7040
7029
  case 32 /* LessThanEqualsToken */:
7041
7030
  case 33 /* GreaterThanEqualsToken */:
7031
+ // Na tag, também o `as` (CK-83): a asserção não é da Linguagem, e o parser não a lê.
7042
7032
  case 97 /* InKeyword */:
7043
- case 123 /* AsKeyword */:
7044
7033
  return 11;
7045
7034
  case 47 /* LessThanLessThanToken */:
7046
7035
  case 48 /* GreaterThanGreaterThanToken */:
@@ -8060,8 +8049,6 @@ function forEachChild(node, cbNode, cbNodes) {
8060
8049
  return visitNode(cbNode, node.operand);
8061
8050
  case 209 /* BinaryExpression */:
8062
8051
  return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right);
8063
- case 217 /* AsExpression */:
8064
- return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type);
8065
8052
  case 219 /* MetaProperty */:
8066
8053
  return visitNode(cbNode, node.name);
8067
8054
  case 210 /* ConditionalExpression */:
@@ -9611,7 +9598,8 @@ var Parser;
9611
9598
  }
9612
9599
  function parseNonArrayType() {
9613
9600
  switch (token()) {
9614
- case 125 /* AnyKeyword */:
9601
+ // Na tag, também o `any` (CK-82): a palavra é um nome comum (CK-56), e o tipo que a escreve, o nome que não se
9602
+ // acha.
9615
9603
  case 148 /* UnknownKeyword */:
9616
9604
  case 143 /* StringKeyword */:
9617
9605
  case 140 /* NumberKeyword */:
@@ -9654,7 +9642,6 @@ var Parser;
9654
9642
  }
9655
9643
  function isStartOfType(inStartOfParameter) {
9656
9644
  switch (token()) {
9657
- case 125 /* AnyKeyword */:
9658
9645
  case 148 /* UnknownKeyword */:
9659
9646
  case 143 /* StringKeyword */:
9660
9647
  case 140 /* NumberKeyword */:
@@ -10167,16 +10154,7 @@ var Parser;
10167
10154
  if (token() === 97 /* InKeyword */ && inDisallowInContext()) {
10168
10155
  break;
10169
10156
  }
10170
- if (token() === 123 /* AsKeyword */) {
10171
- if (scanner.hasPrecedingLineBreak()) {
10172
- break;
10173
- } else {
10174
- nextToken();
10175
- leftOperand = makeAsExpression(leftOperand, parseType());
10176
- }
10177
- } else {
10178
- leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence));
10179
- }
10157
+ leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence));
10180
10158
  }
10181
10159
  return leftOperand;
10182
10160
  }
@@ -10193,12 +10171,6 @@ var Parser;
10193
10171
  node.right = right;
10194
10172
  return finishNode(node);
10195
10173
  }
10196
- function makeAsExpression(left, right) {
10197
- const node = createNode2(217 /* AsExpression */, left.pos);
10198
- node.expression = left;
10199
- node.type = right;
10200
- return finishNode(node);
10201
- }
10202
10174
  function parsePrefixUnaryExpression() {
10203
10175
  const node = createNode2(207 /* PrefixUnaryExpression */);
10204
10176
  node.operator = token();
@@ -12896,15 +12868,6 @@ function updateSpread(node, expression) {
12896
12868
  function createOmittedExpression() {
12897
12869
  return createSynthesizedNode(215 /* OmittedExpression */);
12898
12870
  }
12899
- function createAsExpression(expression, type) {
12900
- const node = createSynthesizedNode(217 /* AsExpression */);
12901
- node.expression = expression;
12902
- node.type = type;
12903
- return node;
12904
- }
12905
- function updateAsExpression(node, expression, type) {
12906
- return node.expression !== expression || node.type !== type ? updateNode(createAsExpression(expression, type), node) : node;
12907
- }
12908
12871
  function createMetaProperty(keywordToken, name) {
12909
12872
  const node = createSynthesizedNode(219 /* MetaProperty */);
12910
12873
  node.keywordToken = keywordToken;
@@ -13832,7 +13795,6 @@ function getLeftmostExpression(node) {
13832
13795
  node = node.condition;
13833
13796
  continue;
13834
13797
  case 196 /* CallExpression */:
13835
- case 217 /* AsExpression */:
13836
13798
  case 195 /* ElementAccessExpression */:
13837
13799
  case 194 /* PropertyAccessExpression */:
13838
13800
  case 326 /* PartiallyEmittedExpression */:
@@ -13853,24 +13815,20 @@ function isCommaSequence(node) {
13853
13815
  }
13854
13816
  var OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
13855
13817
  OuterExpressionKinds2[OuterExpressionKinds2["Parentheses"] = 1] = "Parentheses";
13856
- OuterExpressionKinds2[OuterExpressionKinds2["TypeAssertions"] = 2] = "TypeAssertions";
13857
13818
  OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions";
13858
- OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 2 /* TypeAssertions */] = "Assertions";
13859
- OuterExpressionKinds2[OuterExpressionKinds2["All"] = 11] = "All";
13819
+ OuterExpressionKinds2[OuterExpressionKinds2["All"] = 9] = "All";
13860
13820
  return OuterExpressionKinds2;
13861
13821
  })(OuterExpressionKinds || {});
13862
- function isOuterExpression(node, kinds = 11 /* All */) {
13822
+ function isOuterExpression(node, kinds = 9 /* All */) {
13863
13823
  switch (node.kind) {
13864
13824
  case 200 /* ParenthesizedExpression */:
13865
13825
  return (kinds & 1 /* Parentheses */) !== 0;
13866
- case 217 /* AsExpression */:
13867
- return (kinds & 2 /* TypeAssertions */) !== 0;
13868
13826
  case 326 /* PartiallyEmittedExpression */:
13869
13827
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
13870
13828
  }
13871
13829
  return false;
13872
13830
  }
13873
- function skipOuterExpressions(node, kinds = 11 /* All */) {
13831
+ function skipOuterExpressions(node, kinds = 9 /* All */) {
13874
13832
  while (isOuterExpression(node, kinds)) {
13875
13833
  node = node.expression;
13876
13834
  }
@@ -13880,8 +13838,6 @@ function updateOuterExpression(outerExpression, expression) {
13880
13838
  switch (outerExpression.kind) {
13881
13839
  case 200 /* ParenthesizedExpression */:
13882
13840
  return updateParen(outerExpression, expression);
13883
- case 217 /* AsExpression */:
13884
- return updateAsExpression(outerExpression, expression, outerExpression.type);
13885
13841
  case 326 /* PartiallyEmittedExpression */:
13886
13842
  return updatePartiallyEmittedExpression(outerExpression, expression);
13887
13843
  }
@@ -13889,7 +13845,7 @@ function updateOuterExpression(outerExpression, expression) {
13889
13845
  function isIgnorableParen(node) {
13890
13846
  return node.kind === 200 /* ParenthesizedExpression */ && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node));
13891
13847
  }
13892
- function recreateOuterExpressions(outerExpression, innerExpression, kinds = 11 /* All */) {
13848
+ function recreateOuterExpressions(outerExpression, innerExpression, kinds = 9 /* All */) {
13893
13849
  if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) {
13894
13850
  return updateOuterExpression(
13895
13851
  outerExpression,
@@ -14453,12 +14409,6 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke
14453
14409
  node,
14454
14410
  visitNode2(node.expression, visitor, isExpression)
14455
14411
  );
14456
- case 217 /* AsExpression */:
14457
- return updateAsExpression(
14458
- node,
14459
- visitNode2(node.expression, visitor, isExpression),
14460
- visitNode2(node.type, visitor, isTypeNode)
14461
- );
14462
14412
  case 219 /* MetaProperty */:
14463
14413
  return updateMetaProperty(
14464
14414
  node,
@@ -14925,7 +14875,6 @@ export {
14925
14875
  createArrayLiteral,
14926
14876
  createArrayTypeNode,
14927
14877
  createArrowFunction,
14928
- createAsExpression,
14929
14878
  createAssignment,
14930
14879
  createAwait,
14931
14880
  createBigIntLiteral,
@@ -15279,8 +15228,6 @@ export {
15279
15228
  isArrayLiteralExpression,
15280
15229
  isArrayTypeNode,
15281
15230
  isArrowFunction,
15282
- isAsExpression,
15283
- isAssertionExpression,
15284
15231
  isAssignmentDeclaration,
15285
15232
  isAssignmentExpression,
15286
15233
  isAssignmentOperator,
@@ -15697,7 +15644,6 @@ export {
15697
15644
  updateArrayLiteral,
15698
15645
  updateArrayTypeNode,
15699
15646
  updateArrowFunction,
15700
- updateAsExpression,
15701
15647
  updateAwait,
15702
15648
  updateBinary,
15703
15649
  updateBindingElement,
package/dist/factory.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SyntaxKind } from "./_namespaces/ts.js";
2
- import type { ArrayBindingOrAssignmentPattern, AsExpression, 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";
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
- Assertions = 2,
57
- All = 11
55
+ All = 9
58
56
  }
59
- export type OuterExpression = ParenthesizedExpression | AsExpression | PartiallyEmittedExpression;
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;
@@ -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, AsExpression, 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";
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 | AssertionExpression | TypeAliasDeclaration;
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, AsExpression, AssertionExpression, 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";
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.16.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",