commit 5bb8de296052e9a27802142f80a160e0a1b1bb55
parent b7a45029d5bc92077c38b3e419dcf58f20f7ef54
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 3 Sep 2021 09:29:29 +0200
hare::unit: moar docs
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/hare/unit/scope.ha b/hare/unit/scope.ha
@@ -4,6 +4,7 @@ use hash::fnv;
use hash;
use strings;
+// What sort of [[object]] is represented.
export type object_kind = enum {
BIND,
CONST,
@@ -11,6 +12,8 @@ export type object_kind = enum {
TYPE,
};
+// An object is a named object in a scope, such as a binding, type, or
+// declaration.
export type object = struct {
kind: object_kind,
hash: u64,
@@ -26,6 +29,7 @@ export type object = struct {
export def SCOPE_BUCKETS: size = 4096;
+// What kind of [[scope]] is represented.
export type scope_class = enum {
COMPOUND,
ENUM,
@@ -36,6 +40,8 @@ export type scope_class = enum {
UNIT,
};
+// A scope is a member of a hierarchy of storage containers which hold named
+// [[object]]s, such as variables or function parameters.
export type scope = struct {
class: scope_class,
parent: nullable *scope,