Skip to content

Commit 1cb493b

Browse files
authored
Merge pull request #1561 from glimmerjs/revise-ast-changes
[CLEANUP] Remove unused ASTv1 nodes
2 parents d735053 + 85cc0f0 commit 1cb493b

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
@@ -369,14 +369,6 @@ function buildHeadFromString(head: string, loc: SourceLocation): ASTv1.PathHead
369369
}
370370
}
371371

372-
function buildNamedBlockName(name: string, loc?: SourceLocation): ASTv1.NamedBlockName {
373-
return {
374-
type: 'NamedBlockName',
375-
name,
376-
loc: buildLoc(loc || null),
377-
};
378-
}
379-
380372
function buildCleanPath(
381373
head: ASTv1.PathHead,
382374
tail: string[],
@@ -572,7 +564,6 @@ export default {
572564
at: buildAtName,
573565
var: buildVar,
574566
this: buildThis,
575-
blockName: buildNamedBlockName,
576567

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

0 commit comments

Comments
 (0)