Removed unused struct fields
This commit is contained in:
parent
8ec0e02dbe
commit
f4e4e49fce
@ -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()
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user