Moved register state to scopes
This commit is contained in:
@ -15,12 +15,12 @@ type Variable struct {
|
||||
|
||||
// Variable returns the variable with the given name or `nil` if it doesn't exist.
|
||||
func (s *state) Variable(name string) *Variable {
|
||||
return s.Scope()[name]
|
||||
return s.Scope().variables[name]
|
||||
}
|
||||
|
||||
// VariableInRegister returns the variable that occupies the given register or `nil` if none occupy the register.
|
||||
func (s *state) VariableInRegister(register cpu.Register) *Variable {
|
||||
for _, v := range s.Scope() {
|
||||
for _, v := range s.Scope().variables {
|
||||
if v.Register == register {
|
||||
return v
|
||||
}
|
||||
|
Reference in New Issue
Block a user