Skip to content

Commit 85cc0f0

Browse files
committed
[CLEANUP] Remove unused ASTv1 nodes
Technically this is a breaking change, but as far as I/TypeScript can tell, these don't actually do anything, so presumably no one is using them. Most of these appear to be ideas and experiments that didn't pan out, or landed in a different form (e.g. in ASTv2).
1 parent dc76897 commit 85cc0f0

File tree

3 files changed

+2
-55
lines changed

3 files changed

+2
-55
lines changed

packages/@glimmer/syntax/lib/generation/printer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function getVoidTags() {
2828
const NON_WHITESPACE = /^\S/u;
2929

3030
export interface PrinterOptions {
31-
entityEncoding: 'transformed' | 'raw';
31+
entityEncoding: ASTv1.EntityEncodingState;
3232

3333
/**
3434
* Used to override the mechanism of printing a given AST.Node.

packages/@glimmer/syntax/lib/v1/nodes-v1.ts

+1-45
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,7 @@
1-
import type { Dict, Nullable, PresentArray, WireFormat } from '@glimmer/interfaces';
1+
import type { Nullable, PresentArray } from '@glimmer/interfaces';
22

33
import type * as src from '../source/api';
44

5-
export interface Symbols {
6-
symbols: string[];
7-
8-
has(name: string): boolean;
9-
get(name: string): number;
10-
11-
getLocalsMap(): Dict<number>;
12-
getDebugInfo(): WireFormat.Core.DebugInfo;
13-
14-
allocateFree(name: string): number;
15-
allocateNamed(name: string): number;
16-
allocateBlock(name: string): number;
17-
allocate(identifier: string): number;
18-
19-
child(locals: string[]): BlockSymbols;
20-
}
21-
22-
export interface BlockSymbols extends Symbols {
23-
slots: number[];
24-
}
25-
26-
export interface ProgramSymbols extends Symbols {
27-
freeVariables: string[];
28-
}
29-
305
export interface BaseNode {
316
// Every leaf interface that extends BaseNode must specify a type property.
327
// The type property should be a string literal. For example, Identifier
@@ -43,7 +18,6 @@ export interface CommonProgram extends BaseNode {
4318

4419
export interface Program extends CommonProgram {
4520
type: 'Program';
46-
symbols?: Symbols;
4721
}
4822

4923
export interface Block extends CommonProgram {
@@ -130,12 +104,6 @@ export interface MustacheCommentStatement extends BaseNode {
130104
value: string;
131105
}
132106

133-
export interface NamedBlockName {
134-
type: 'NamedBlockName';
135-
name: string;
136-
loc: src.SourceLocation;
137-
}
138-
139107
export interface ElementName {
140108
type: 'ElementName';
141109
name: string;
@@ -241,18 +209,6 @@ export interface VarHead {
241209
loc: src.SourceLocation;
242210
}
243211

244-
export interface FreeVarHead {
245-
type: 'FreeVarHead';
246-
name: string;
247-
loc: src.SourceLocation;
248-
}
249-
250-
export interface LocalVarHead {
251-
type: 'LocalVarHead';
252-
name: string;
253-
loc: src.SourceLocation;
254-
}
255-
256212
export type PathHead = ThisHead | AtHead | VarHead;
257213

258214
export interface MinimalPathExpression extends BaseNode {

packages/@glimmer/syntax/lib/v1/public-builders.ts

-9
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,6 @@ function buildHeadFromString(head: string, loc: SourceLocation): ASTv1.PathHead
374374
}
375375
}
376376

377-
function buildNamedBlockName(name: string, loc?: SourceLocation): ASTv1.NamedBlockName {
378-
return {
379-
type: 'NamedBlockName',
380-
name,
381-
loc: buildLoc(loc || null),
382-
};
383-
}
384-
385377
function buildCleanPath(
386378
head: ASTv1.PathHead,
387379
tail: string[],
@@ -577,7 +569,6 @@ export default {
577569
at: buildAtName,
578570
var: buildVar,
579571
this: buildThis,
580-
blockName: buildNamedBlockName,
581572

582573
string: literal('StringLiteral') as (value: string) => ASTv1.StringLiteral,
583574
boolean: literal('BooleanLiteral') as (value: boolean) => ASTv1.BooleanLiteral,

0 commit comments

Comments
 (0)