@tslite/parser 1.16.1 → 1.18.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.
@@ -1,3 +1,4 @@
1
+ export { packageVersion } from "../packageVersion.js";
1
2
  export * from "../shims/mapShim.js";
2
3
  export * from "../corePublic.js";
3
4
  export * from "../core.js";
@@ -11,6 +11,9 @@ var __export = (target, all) => {
11
11
  __defProp(target, name, { get: all[name], enumerable: true });
12
12
  };
13
13
 
14
+ // src/packageVersion.ts
15
+ var packageVersion = "1.18.0";
16
+
14
17
  // src/shims/mapShim.ts
15
18
  function createMapShim() {
16
19
  function createDictionaryObject() {
@@ -2923,7 +2926,6 @@ function tokenIsIdentifierOrKeywordOrGreaterThan(token) {
2923
2926
  return token === 31 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token);
2924
2927
  }
2925
2928
  var textToKeywordObj = {
2926
- any: 125 /* AnyKeyword */,
2927
2929
  as: 123 /* AsKeyword */,
2928
2930
  asserts: 124 /* AssertsKeyword */,
2929
2931
  bigint: 151 /* BigIntKeyword */,
@@ -3079,6 +3081,7 @@ function makeReverseMap(source) {
3079
3081
  return result;
3080
3082
  }
3081
3083
  var tokenStrings = makeReverseMap(textToToken);
3084
+ tokenStrings[125 /* AnyKeyword */] = "any";
3082
3085
  function tokenToString(t) {
3083
3086
  return tokenStrings[t];
3084
3087
  }
@@ -5122,9 +5125,6 @@ function isSpreadElement(node) {
5122
5125
  function isOmittedExpression(node) {
5123
5126
  return node.kind === 215 /* OmittedExpression */;
5124
5127
  }
5125
- function isAsExpression(node) {
5126
- return node.kind === 217 /* AsExpression */;
5127
- }
5128
5128
  function isMetaProperty(node) {
5129
5129
  return node.kind === 219 /* MetaProperty */;
5130
5130
  }
@@ -5511,7 +5511,6 @@ function isExpressionKind(kind) {
5511
5511
  case 202 /* ArrowFunction */:
5512
5512
  case 209 /* BinaryExpression */:
5513
5513
  case 213 /* SpreadElement */:
5514
- case 217 /* AsExpression */:
5515
5514
  case 215 /* OmittedExpression */:
5516
5515
  case 327 /* CommaListExpression */:
5517
5516
  case 326 /* PartiallyEmittedExpression */:
@@ -5520,10 +5519,6 @@ function isExpressionKind(kind) {
5520
5519
  return isUnaryExpressionKind(kind);
5521
5520
  }
5522
5521
  }
5523
- function isAssertionExpression(node) {
5524
- const kind = node.kind;
5525
- return kind === 217 /* AsExpression */;
5526
- }
5527
5522
  function isNotEmittedStatement(node) {
5528
5523
  return node.kind === 325 /* NotEmittedStatement */;
5529
5524
  }
@@ -6280,7 +6275,6 @@ function isExpressionNode(node) {
6280
6275
  case 194 /* PropertyAccessExpression */:
6281
6276
  case 195 /* ElementAccessExpression */:
6282
6277
  case 196 /* CallExpression */:
6283
- case 217 /* AsExpression */:
6284
6278
  case 200 /* ParenthesizedExpression */:
6285
6279
  case 202 /* ArrowFunction */:
6286
6280
  case 203 /* DeleteExpression */:
@@ -6342,8 +6336,6 @@ function isInExpressionContext(node) {
6342
6336
  case 232 /* ForOfStatement */:
6343
6337
  const forInStatement = parent;
6344
6338
  return forInStatement.initializer === node && forInStatement.initializer.kind !== 243 /* VariableDeclarationList */ || forInStatement.expression === node;
6345
- case 217 /* AsExpression */:
6346
- return node === parent.expression;
6347
6339
  case 221 /* TemplateSpan */:
6348
6340
  return node === parent.expression;
6349
6341
  case 154 /* ComputedPropertyName */:
@@ -7039,8 +7031,8 @@ function getBinaryOperatorPrecedence(kind) {
7039
7031
  case 31 /* GreaterThanToken */:
7040
7032
  case 32 /* LessThanEqualsToken */:
7041
7033
  case 33 /* GreaterThanEqualsToken */:
7034
+ // Na tag, também o `as` (CK-83): a asserção não é da Linguagem, e o parser não a lê.
7042
7035
  case 97 /* InKeyword */:
7043
- case 123 /* AsKeyword */:
7044
7036
  return 11;
7045
7037
  case 47 /* LessThanLessThanToken */:
7046
7038
  case 48 /* GreaterThanGreaterThanToken */:
@@ -8060,8 +8052,6 @@ function forEachChild(node, cbNode, cbNodes) {
8060
8052
  return visitNode(cbNode, node.operand);
8061
8053
  case 209 /* BinaryExpression */:
8062
8054
  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
8055
  case 219 /* MetaProperty */:
8066
8056
  return visitNode(cbNode, node.name);
8067
8057
  case 210 /* ConditionalExpression */:
@@ -9611,7 +9601,8 @@ var Parser;
9611
9601
  }
9612
9602
  function parseNonArrayType() {
9613
9603
  switch (token()) {
9614
- case 125 /* AnyKeyword */:
9604
+ // 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
9605
+ // acha.
9615
9606
  case 148 /* UnknownKeyword */:
9616
9607
  case 143 /* StringKeyword */:
9617
9608
  case 140 /* NumberKeyword */:
@@ -9654,7 +9645,6 @@ var Parser;
9654
9645
  }
9655
9646
  function isStartOfType(inStartOfParameter) {
9656
9647
  switch (token()) {
9657
- case 125 /* AnyKeyword */:
9658
9648
  case 148 /* UnknownKeyword */:
9659
9649
  case 143 /* StringKeyword */:
9660
9650
  case 140 /* NumberKeyword */:
@@ -10167,16 +10157,7 @@ var Parser;
10167
10157
  if (token() === 97 /* InKeyword */ && inDisallowInContext()) {
10168
10158
  break;
10169
10159
  }
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
- }
10160
+ leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence));
10180
10161
  }
10181
10162
  return leftOperand;
10182
10163
  }
@@ -10193,12 +10174,6 @@ var Parser;
10193
10174
  node.right = right;
10194
10175
  return finishNode(node);
10195
10176
  }
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
10177
  function parsePrefixUnaryExpression() {
10203
10178
  const node = createNode2(207 /* PrefixUnaryExpression */);
10204
10179
  node.operator = token();
@@ -12896,15 +12871,6 @@ function updateSpread(node, expression) {
12896
12871
  function createOmittedExpression() {
12897
12872
  return createSynthesizedNode(215 /* OmittedExpression */);
12898
12873
  }
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
12874
  function createMetaProperty(keywordToken, name) {
12909
12875
  const node = createSynthesizedNode(219 /* MetaProperty */);
12910
12876
  node.keywordToken = keywordToken;
@@ -13832,7 +13798,6 @@ function getLeftmostExpression(node) {
13832
13798
  node = node.condition;
13833
13799
  continue;
13834
13800
  case 196 /* CallExpression */:
13835
- case 217 /* AsExpression */:
13836
13801
  case 195 /* ElementAccessExpression */:
13837
13802
  case 194 /* PropertyAccessExpression */:
13838
13803
  case 326 /* PartiallyEmittedExpression */:
@@ -13853,24 +13818,20 @@ function isCommaSequence(node) {
13853
13818
  }
13854
13819
  var OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
13855
13820
  OuterExpressionKinds2[OuterExpressionKinds2["Parentheses"] = 1] = "Parentheses";
13856
- OuterExpressionKinds2[OuterExpressionKinds2["TypeAssertions"] = 2] = "TypeAssertions";
13857
13821
  OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions";
13858
- OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 2 /* TypeAssertions */] = "Assertions";
13859
- OuterExpressionKinds2[OuterExpressionKinds2["All"] = 11] = "All";
13822
+ OuterExpressionKinds2[OuterExpressionKinds2["All"] = 9] = "All";
13860
13823
  return OuterExpressionKinds2;
13861
13824
  })(OuterExpressionKinds || {});
13862
- function isOuterExpression(node, kinds = 11 /* All */) {
13825
+ function isOuterExpression(node, kinds = 9 /* All */) {
13863
13826
  switch (node.kind) {
13864
13827
  case 200 /* ParenthesizedExpression */:
13865
13828
  return (kinds & 1 /* Parentheses */) !== 0;
13866
- case 217 /* AsExpression */:
13867
- return (kinds & 2 /* TypeAssertions */) !== 0;
13868
13829
  case 326 /* PartiallyEmittedExpression */:
13869
13830
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
13870
13831
  }
13871
13832
  return false;
13872
13833
  }
13873
- function skipOuterExpressions(node, kinds = 11 /* All */) {
13834
+ function skipOuterExpressions(node, kinds = 9 /* All */) {
13874
13835
  while (isOuterExpression(node, kinds)) {
13875
13836
  node = node.expression;
13876
13837
  }
@@ -13880,8 +13841,6 @@ function updateOuterExpression(outerExpression, expression) {
13880
13841
  switch (outerExpression.kind) {
13881
13842
  case 200 /* ParenthesizedExpression */:
13882
13843
  return updateParen(outerExpression, expression);
13883
- case 217 /* AsExpression */:
13884
- return updateAsExpression(outerExpression, expression, outerExpression.type);
13885
13844
  case 326 /* PartiallyEmittedExpression */:
13886
13845
  return updatePartiallyEmittedExpression(outerExpression, expression);
13887
13846
  }
@@ -13889,7 +13848,7 @@ function updateOuterExpression(outerExpression, expression) {
13889
13848
  function isIgnorableParen(node) {
13890
13849
  return node.kind === 200 /* ParenthesizedExpression */ && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node));
13891
13850
  }
13892
- function recreateOuterExpressions(outerExpression, innerExpression, kinds = 11 /* All */) {
13851
+ function recreateOuterExpressions(outerExpression, innerExpression, kinds = 9 /* All */) {
13893
13852
  if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) {
13894
13853
  return updateOuterExpression(
13895
13854
  outerExpression,
@@ -14453,12 +14412,6 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke
14453
14412
  node,
14454
14413
  visitNode2(node.expression, visitor, isExpression)
14455
14414
  );
14456
- case 217 /* AsExpression */:
14457
- return updateAsExpression(
14458
- node,
14459
- visitNode2(node.expression, visitor, isExpression),
14460
- visitNode2(node.type, visitor, isTypeNode)
14461
- );
14462
14415
  case 219 /* MetaProperty */:
14463
14416
  return updateMetaProperty(
14464
14417
  node,
@@ -14925,7 +14878,6 @@ export {
14925
14878
  createArrayLiteral,
14926
14879
  createArrayTypeNode,
14927
14880
  createArrowFunction,
14928
- createAsExpression,
14929
14881
  createAssignment,
14930
14882
  createAwait,
14931
14883
  createBigIntLiteral,
@@ -15279,8 +15231,6 @@ export {
15279
15231
  isArrayLiteralExpression,
15280
15232
  isArrayTypeNode,
15281
15233
  isArrowFunction,
15282
- isAsExpression,
15283
- isAssertionExpression,
15284
15234
  isAssignmentDeclaration,
15285
15235
  isAssignmentExpression,
15286
15236
  isAssignmentOperator,
@@ -15574,6 +15524,7 @@ export {
15574
15524
  objectAllocator,
15575
15525
  or,
15576
15526
  orderedRemoveItemAt,
15527
+ packageVersion,
15577
15528
  parenthesizeArrayTypeMember,
15578
15529
  parenthesizeBinaryOperand,
15579
15530
  parenthesizeConciseBody,
@@ -15697,7 +15648,6 @@ export {
15697
15648
  updateArrayLiteral,
15698
15649
  updateArrayTypeNode,
15699
15650
  updateArrowFunction,
15700
- updateAsExpression,
15701
15651
  updateAwait,
15702
15652
  updateBinary,
15703
15653
  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;
@@ -0,0 +1,2 @@
1
+ /** A versão deste package, a do módulo de fato carregado. */
2
+ export declare const packageVersion = "1.18.0";
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.18.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",