Skip to content

Commit e0ec460

Browse files
committed
feat: rename
1 parent 1350cc9 commit e0ec460

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

packages/shader-lab/src/codeGen/VisitorContext.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EShaderStage } from "../common/Enums";
22
import { ASTNode } from "../parser/AST";
3-
import { ESymbolType, SymbolTable, SymbolInfo } from "../parser/symbolTable";
3+
import { ESymbolType, TargetSymbolTable, SymbolInfo } from "../parser/symbolTable";
44
import { IParamInfo, StructProp } from "../parser/types";
55
import { GSErrorName } from "../GSError";
66
import { BaseToken } from "../common/BaseToken";
@@ -35,7 +35,7 @@ export class VisitorContext {
3535

3636
_curFn?: ASTNode.FunctionProtoType;
3737

38-
_passSymbolTable: SymbolTable;
38+
_passSymbolTable: TargetSymbolTable;
3939

4040
private constructor() {}
4141

packages/shader-lab/src/parser/SemanticAnalyzer.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ShaderRange } from "../common";
22
import { ASTNode, TreeNode } from "./AST";
33
import { GSErrorName } from "../GSError";
44
import { ShaderData } from "./ShaderInfo";
5-
import { ESymbolType, SymbolInfo, SymbolTable } from "../parser/symbolTable";
5+
import { ESymbolType, SymbolInfo, TargetSymbolTable } from "../parser/symbolTable";
66
import { NodeChild } from "./types";
77
import { SymbolTableStack } from "../common/BaseSymbolTable";
88
import { ShaderLab } from "../ShaderLab";
@@ -24,7 +24,7 @@ export type TranslationRule<T = any> = (sa: SematicAnalyzer, ...tokens: NodeChil
2424
export default class SematicAnalyzer {
2525
semanticStack: TreeNode[] = [];
2626
acceptRule?: TranslationRule = undefined;
27-
symbolTableStack: SymbolTableStack<SymbolInfo, SymbolTable> = new SymbolTableStack();
27+
symbolTableStack: SymbolTableStack<SymbolInfo, TargetSymbolTable> = new SymbolTableStack();
2828
curFunctionInfo: {
2929
header?: ASTNode.FunctionDeclarator;
3030
returnStatement?: ASTNode.JumpStatement;
@@ -55,7 +55,7 @@ export default class SematicAnalyzer {
5555
}
5656

5757
newScope() {
58-
const scope = new SymbolTable();
58+
const scope = new TargetSymbolTable();
5959
this.symbolTableStack.newScope(scope);
6060
}
6161

packages/shader-lab/src/parser/ShaderInfo.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { ASTNode } from "./AST";
2-
import { SymbolTable } from "../parser/symbolTable";
2+
import { TargetSymbolTable } from "../parser/symbolTable";
33

44
export class ShaderData {
5-
symbolTable: SymbolTable;
5+
symbolTable: TargetSymbolTable;
66

77
vertexMain: ASTNode.FunctionDefinition;
88
fragmentMain: ASTNode.FunctionDefinition;

packages/shader-lab/src/parser/symbolTable/SymbolTable.ts packages/shader-lab/src/parser/symbolTable/TargetSymbolTable.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { StructSymbol } from "./StructSymbol";
77
import { ESymbolType, SymbolAstNode, SymbolInfo } from "./SymbolInfo";
88
import { VarSymbol } from "./VarSymbol";
99

10-
export class SymbolTable extends BaseSymbolTable<SymbolInfo> {
10+
export class TargetSymbolTable extends BaseSymbolTable<SymbolInfo> {
1111
override insert(sm: SymbolInfo): void {
1212
const entry = this._table.get(sm.ident) ?? [];
1313
for (let i = 0; i < entry.length; i++) {

packages/shader-lab/src/parser/symbolTable/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ export * from "./FnSymbol";
22
export * from "./StructSymbol";
33
export * from "./SymbolDataType";
44
export * from "./SymbolInfo";
5-
export * from "./SymbolTable";
5+
export * from "./TargetSymbolTable";
66
export * from "./VarSymbol";

0 commit comments

Comments
 (0)