MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / VariableReference

Class VariableReference

src/interpreter/reference.ts:37–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37class VariableReference implements Reference {
38 constructor(private name: string, private scope: Scope) {
39 this.type = 'reference';
40 }
41
42 type: 'reference';
43
44 get(): Value {
45 return this.scope.get(this.name);
46 }
47
48 set(value: Value): void {
49 this.scope.assign(this.name, value);
50 }
51}
52
53class IndexReference implements Reference {
54 constructor(private target: Value[], private index: number) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected