Clean up unused nodes in cst.ts
This commit is contained in:
parent
6c29d49ac6
commit
1a4a07bdd1
3 changed files with 0 additions and 60 deletions
|
@ -59,14 +59,6 @@ export class Analyser {
|
|||
break;
|
||||
}
|
||||
|
||||
case SyntaxKind.NamedTupleExpression:
|
||||
{
|
||||
for (const arg of node.elements) {
|
||||
visit(arg, source);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SyntaxKind.StructExpression:
|
||||
{
|
||||
for (const member of node.members) {
|
||||
|
|
51
src/cst.ts
51
src/cst.ts
|
@ -136,7 +136,6 @@ export const enum SyntaxKind {
|
|||
MemberExpression,
|
||||
CallExpression,
|
||||
ReferenceExpression,
|
||||
NamedTupleExpression,
|
||||
StructExpression,
|
||||
TupleExpression,
|
||||
NestedExpression,
|
||||
|
@ -175,7 +174,6 @@ export const enum SyntaxKind {
|
|||
WrappedOperator,
|
||||
MatchArm,
|
||||
Initializer,
|
||||
QualifiedName,
|
||||
TypeAssert,
|
||||
Param,
|
||||
Module,
|
||||
|
@ -1408,30 +1406,6 @@ export class ConstantExpression extends SyntaxBase {
|
|||
|
||||
}
|
||||
|
||||
export class QualifiedName extends SyntaxBase {
|
||||
|
||||
public readonly kind = SyntaxKind.QualifiedName;
|
||||
|
||||
public constructor(
|
||||
public modulePath: Array<[IdentifierAlt, Dot]>,
|
||||
public name: Identifier,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
public getFirstToken(): Token {
|
||||
if (this.modulePath.length > 0) {
|
||||
return this.modulePath[0][0];
|
||||
}
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public getLastToken(): Token {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class CallExpression extends SyntaxBase {
|
||||
|
||||
public readonly kind = SyntaxKind.CallExpression;
|
||||
|
@ -1524,30 +1498,6 @@ export class StructExpression extends SyntaxBase {
|
|||
|
||||
}
|
||||
|
||||
export class NamedTupleExpression extends SyntaxBase {
|
||||
|
||||
public readonly kind = SyntaxKind.NamedTupleExpression;
|
||||
|
||||
public constructor(
|
||||
public name: IdentifierAlt,
|
||||
public elements: Expression[],
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
public getFirstToken(): Token {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public getLastToken(): Token {
|
||||
if (this.elements.length > 0) {
|
||||
return this.elements[this.elements.length-1].getLastToken();
|
||||
}
|
||||
return this.name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class MatchArm extends SyntaxBase {
|
||||
|
||||
public readonly kind = SyntaxKind.MatchArm;
|
||||
|
@ -1711,7 +1661,6 @@ export type Expression
|
|||
= MemberExpression
|
||||
| CallExpression
|
||||
| StructExpression
|
||||
| NamedTupleExpression
|
||||
| ReferenceExpression
|
||||
| ConstantExpression
|
||||
| TupleExpression
|
||||
|
|
|
@ -81,7 +81,6 @@ const DESCRIPTIONS: Partial<Record<SyntaxKind, string>> = {
|
|||
[SyntaxKind.ReferenceExpression]: 'a reference to some variable',
|
||||
[SyntaxKind.NestedExpression]: 'an expression nested with parentheses',
|
||||
[SyntaxKind.ConstantExpression]: 'a constant expression such as 1 or "foo"',
|
||||
[SyntaxKind.NamedTupleExpression]: 'a named tuple expression',
|
||||
[SyntaxKind.StructExpression]: 'a struct expression',
|
||||
[SyntaxKind.BlockStart]: 'the start of an indented block',
|
||||
[SyntaxKind.BlockEnd]: 'the end of an indented block',
|
||||
|
|
Loading…
Reference in a new issue