Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/typescript/src/api/node/protocol.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const childProperties: Readonly<Partial<Record<SyntaxKind, readonly (stri
[SyntaxKind.SwitchStatement]: ["expression", "caseBlock"],
[SyntaxKind.CaseBlock]: ["clauses"],
[SyntaxKind.CaseClause]: ["expression", "statements"],
[SyntaxKind.DefaultClause]: ["expression", "statements"],
[SyntaxKind.DefaultClause]: ["statements"],
[SyntaxKind.ThrowStatement]: ["expression"],
[SyntaxKind.TryStatement]: ["tryBlock", "catchClause", "finallyBlock"],
[SyntaxKind.CatchClause]: ["variableDeclaration", "block"],
Expand Down Expand Up @@ -185,6 +185,7 @@ export const singleChildNodePropertyNames: Readonly<Partial<Record<SyntaxKind, s
[SyntaxKind.ContinueStatement]: "label",
[SyntaxKind.ReturnStatement]: "expression",
[SyntaxKind.CaseBlock]: "clauses",
[SyntaxKind.DefaultClause]: "statements",
[SyntaxKind.ThrowStatement]: "expression",
[SyntaxKind.ExpressionStatement]: "expression",
[SyntaxKind.Block]: "statements",
Expand Down
40 changes: 21 additions & 19 deletions packages/typescript/src/ast/ast.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@ export interface JSDocTagBase extends NodeBase {
readonly tagName: Identifier;
readonly comment?: NodeArray<JSDocComment>;
}
export interface CaseOrDefaultClauseBase extends Node {
readonly statements: NodeArray<Statement>;
}
export interface JSDocCommentBase extends NodeBase {
readonly text: string;
}
Expand Down Expand Up @@ -569,6 +572,13 @@ export interface CaseBlock extends NodeBase {
readonly kind: SyntaxKind.CaseBlock;
readonly clauses: NodeArray<CaseOrDefaultClause>;
}
export interface CaseClause extends NodeBase, CaseOrDefaultClauseBase {
readonly kind: SyntaxKind.CaseClause;
readonly expression: Expression;
}
export interface DefaultClause extends NodeBase, CaseOrDefaultClauseBase {
readonly kind: SyntaxKind.DefaultClause;
}
export interface ThrowStatement extends StatementBase {
readonly kind: SyntaxKind.ThrowStatement;
readonly expression: Expression;
Expand Down Expand Up @@ -703,7 +713,7 @@ export interface NamedImports extends NodeBase {
export interface ExportAssignment extends StatementBase, DeclarationBase, ModifiersBase {
readonly kind: SyntaxKind.ExportAssignment;
readonly isExportEquals: boolean;
readonly type: TypeNode;
readonly type?: TypeNode;
readonly expression: Expression;
}
export interface NamespaceExportDeclaration extends StatementBase, DeclarationBase, ModifiersBase {
Expand Down Expand Up @@ -755,8 +765,8 @@ export interface MethodDeclaration extends NodeBase, DeclarationBase, NamedMembe
}
export interface PropertySignatureDeclaration extends NodeBase, DeclarationBase, NamedMemberBase, TypeElementBase {
readonly kind: SyntaxKind.PropertySignature;
readonly type: TypeNode;
readonly initializer: Expression;
readonly type?: TypeNode;
readonly initializer?: Expression;
}
export interface PropertyDeclaration extends NodeBase, DeclarationBase, NamedMemberBase, ClassElementBase {
readonly kind: SyntaxKind.PropertyDeclaration;
Expand Down Expand Up @@ -892,7 +902,7 @@ export interface TemplateSpan extends NodeBase {
export interface TaggedTemplateExpression extends MemberExpressionBase {
readonly kind: SyntaxKind.TaggedTemplateExpression;
readonly tag: Expression;
readonly questionDotToken: QuestionDotToken;
readonly questionDotToken?: QuestionDotToken;
readonly typeArguments?: NodeArray<TypeNode>;
readonly template: TemplateLiteral;
}
Expand All @@ -916,12 +926,12 @@ export interface SpreadAssignment extends NodeBase, DeclarationBase, ObjectLiter
}
export interface PropertyAssignment extends NodeBase, DeclarationBase, NamedMemberBase, ObjectLiteralElementBase {
readonly kind: SyntaxKind.PropertyAssignment;
readonly type: TypeNode;
readonly type?: TypeNode;
readonly initializer: Expression;
}
export interface ShorthandPropertyAssignment extends NodeBase, DeclarationBase, NamedMemberBase, ObjectLiteralElementBase {
readonly kind: SyntaxKind.ShorthandPropertyAssignment;
readonly type: TypeNode;
readonly type?: TypeNode;
readonly equalsToken?: EqualsToken;
readonly objectAssignmentInitializer?: Expression;
}
Expand Down Expand Up @@ -1055,9 +1065,11 @@ export interface ParenthesizedTypeNode extends TypeNodeBase {
}
export interface FunctionTypeNode extends TypeNodeBase, DeclarationBase, ModifiersBase, FunctionLikeBase {
readonly kind: SyntaxKind.FunctionType;
readonly type: TypeNode;
}
export interface ConstructorTypeNode extends TypeNodeBase, DeclarationBase, ModifiersBase, FunctionLikeBase {
readonly kind: SyntaxKind.ConstructorType;
readonly type: TypeNode;
}
export interface TemplateHead extends NodeBase, TemplateLiteralLikeNodeBase {
readonly kind: SyntaxKind.TemplateHead;
Expand Down Expand Up @@ -1190,7 +1202,7 @@ export interface JSDocUnknownTag extends JSDocTagBase {
}
export interface JSDocTemplateTag extends JSDocTagBase {
readonly kind: SyntaxKind.JSDocTemplateTag;
readonly constraint: Node;
readonly constraint?: Node;
readonly typeParameters: NodeArray<TypeParameterDeclaration>;
}
export interface JSDocReturnTag extends JSDocTagBase {
Expand All @@ -1217,7 +1229,7 @@ export interface JSDocDeprecatedTag extends JSDocTagBase {
}
export interface JSDocSeeTag extends JSDocTagBase {
readonly kind: SyntaxKind.JSDocSeeTag;
readonly nameExpression: TypeNode;
readonly nameExpression?: TypeNode;
}
export interface JSDocImplementsTag extends JSDocTagBase {
readonly kind: SyntaxKind.JSDocImplementsTag;
Expand Down Expand Up @@ -1364,6 +1376,7 @@ export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
export type JsxAttributeName = Identifier | JsxNamespacedName;
export type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName;
export type CaseOrDefaultClause = CaseClause | DefaultClause;
export type ClassLikeDeclaration = ClassDeclaration | ClassExpression;
export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
export type LiteralLikeNode = StringLiteral | NumericLiteral | BigIntLiteral | RegularExpressionLiteral | TemplateLiteralLikeNode | JsxText;
Expand Down Expand Up @@ -1426,16 +1439,6 @@ export interface ForOfStatement extends StatementBase {
readonly expression: Expression;
readonly statement: Statement;
}
export interface CaseClause extends NodeBase {
readonly kind: SyntaxKind.CaseClause;
readonly expression: Expression;
readonly statements: NodeArray<Statement>;
}
export interface DefaultClause extends NodeBase {
readonly kind: SyntaxKind.DefaultClause;
readonly expression: Expression;
readonly statements: NodeArray<Statement>;
}
export interface ObjectBindingPattern extends NodeBase {
readonly kind: SyntaxKind.ObjectBindingPattern;
readonly elements: NodeArray<BindingElement>;
Expand All @@ -1459,7 +1462,6 @@ export interface JSDocPropertyTag extends JSDocTagBase {
readonly isNameFirst: boolean;
}
export type ForInOrOfStatement = ForInStatement | ForOfStatement;
export type CaseOrDefaultClause = CaseClause | DefaultClause;
export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
export type JSDocParameterOrPropertyTag = JSDocParameterTag | JSDocPropertyTag;
export type EndOfFile = Token<SyntaxKind.EndOfFile>;
Expand Down
2 changes: 0 additions & 2 deletions packages/typescript/src/ast/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type {
CaseClause,
ComputedPropertyName,
Decorator,
DefaultClause,
DoStatement,
EndOfFile,
EntityName,
Expand Down Expand Up @@ -265,7 +264,6 @@ export type HasExpression =
| WithStatement
| SwitchStatement
| CaseClause
| DefaultClause
| ThrowStatement
| AssertionExpression
| TemplateSpan
Expand Down
Loading
Loading