Refactor Parsing -> Compiling

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-02 08:25:29 -05:00
parent cfe78a9b29
commit 6dba17c97a
21 changed files with 550 additions and 489 deletions
+4 -2
View File
@@ -69,8 +69,10 @@ public struct Scopes<T>: CustomStringConvertible {
public var description: String {
var result = String()
var counter = 0
for s in scopes {
result += "LexicalScope:\n\(s)\n"
result += "Scope #\(counter):\n\(s)\n"
counter += 1;
}
return result
@@ -107,7 +109,7 @@ public struct Scopes<T>: CustomStringConvertible {
}
public func lookup(identifier: Identifier) -> Result<T> {
for scope in scopes {
for scope in scopes.reversed() {
if let vari = scope.lookup(identifier: identifier) {
return .Ok(vari)
}