aboutsummaryrefslogtreecommitdiff
path: root/decl.go
diff options
context:
space:
mode:
Diffstat (limited to 'decl.go')
-rw-r--r--decl.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/decl.go b/decl.go
index 179acb2..67d641f 100644
--- a/decl.go
+++ b/decl.go
@@ -8,7 +8,7 @@ var funcs = map[string]struct{}{}
var localConsts = map[string]map[string]string{}
var localMuts = map[string]map[string]struct{}{}
-func isDeclared(name string, toplevel bool) bool {
+func isDeclared(name string, toplevel bool) (ok bool, mutable bool) {
if toplevel {
return isDeclaredToplevel(name)
}
@@ -16,13 +16,13 @@ func isDeclared(name string, toplevel bool) bool {
return isDeclaredLocal(currentFunc, name)
}
-func isDeclaredToplevel(name string) bool {
- _, ok := funcs[name]
- return ok
+func isDeclaredToplevel(name string) (ok bool, mutable bool) {
+ _, ok = funcs[name]
+ return
}
-func isDeclaredLocal(function string, local string) bool {
+func isDeclaredLocal(function string, local string) (ok bool, mutable bool) {
_, constant := localConsts[function][local]
- _, mutable := localMuts[function][local]
- return constant || mutable
+ _, mutable = localMuts[function][local]
+ return constant || mutable, mutable
}