diff --git a/src/build/core/CompileDefinition.go b/src/build/core/CompileDefinition.go index e591efa..852fb4f 100644 --- a/src/build/core/CompileDefinition.go +++ b/src/build/core/CompileDefinition.go @@ -41,7 +41,7 @@ func (f *Function) CompileDefinition(node *ast.Define) error { func (f *Function) AddVariable(variable *Variable) { if config.Comments { - f.Comment("%s = %s (%s, %d uses)", variable.Name, variable.Value, variable.Register, variable.Alive) + f.Comment("%s = %s (%d uses)", variable.Name, variable.Register, variable.Alive) } scope := f.Scope() diff --git a/src/build/core/Scope.go b/src/build/core/Scope.go index 4cfcaeb..7aeb163 100644 --- a/src/build/core/Scope.go +++ b/src/build/core/Scope.go @@ -9,9 +9,9 @@ import ( // Scope represents an independent code block. type Scope struct { - cpu.State variables map[string]*Variable inLoop bool + cpu.State } // Scope returns the current scope. @@ -37,7 +37,6 @@ func (f *Function) pushScope(body ast.AST) *Scope { } scope.variables[k] = &Variable{ - Value: v.Value, Name: v.Name, Register: v.Register, Alive: count, diff --git a/src/build/core/Variable.go b/src/build/core/Variable.go index 4f31806..cca96e8 100644 --- a/src/build/core/Variable.go +++ b/src/build/core/Variable.go @@ -2,16 +2,14 @@ package core import ( "git.akyoto.dev/cli/q/src/build/cpu" - "git.akyoto.dev/cli/q/src/build/expression" ) // Variable represents a named register. type Variable struct { - Value *expression.Expression + Scope *Scope Name string Register cpu.Register Alive int - Scope *Scope } // Variable returns the variable with the given name or `nil` if it doesn't exist.