Separated compiler into its own package

This commit is contained in:
Eduard Urbach 2024-07-18 10:08:38 +02:00
parent 38043ca12a
commit 61dc691c65
Signed by: eduard
GPG key ID: 49226B848C78F6C8
14 changed files with 199 additions and 167 deletions

View file

@ -63,6 +63,10 @@ func (f *Function) useVariable(variable *Variable) {
continue
}
if config.Comments {
f.Comment("%s (%s) used in scope %d", local.Name, local.Register, i)
}
local.Alive--
if local.Alive < 0 {
@ -71,7 +75,7 @@ func (f *Function) useVariable(variable *Variable) {
if local.Alive == 0 {
if config.Comments {
f.Comment("%s died (%s) in scope %d", local.Name, local.Register, i)
f.Comment("%s (%s) died in scope %d", local.Name, local.Register, i)
}
scope.Free(local.Register)
@ -87,7 +91,7 @@ func (f *Function) identifierExists(name string) bool {
return true
}
_, exists := f.functions[name]
_, exists := f.Functions[name]
return exists
}