compiler: Remove Too-Early Instatiation Reference (2)
Continuous Integration / Grammar Tests (push) Successful in 38s
Continuous Integration / Library Format Tests (push) Successful in 1m18s
Continuous Integration / Library Tests (push) Failing after 4m32s

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-05-27 13:29:24 -04:00
parent c8d4d4fc65
commit ecc38096b8
+9 -29
View File
@@ -273,36 +273,16 @@ public struct SpecialCompilers {
// If none of the declaration parsers chose to parse, that's an error, too! // If none of the declaration parsers chose to parse, that's an error, too!
if !found_parser { if !found_parser {
let no_parser_error = ErrorWithLocation(
print("spec: \(declaration_node)") sourceLocation: specific_declaration_node.toSourceLocation(),
// Try to see if it is an instantiation! withError: "Could not find parser for declaration node"
if declaration_node.nodeType == "instantiation" { )
switch Instantiation.Compile( errors =
node: declaration_node, withContext: compilation_context) if let errors = errors {
{ errors.append(error: no_parser_error)
case .Ok((let x, let updated_context)): } else {
print("instantiation: \(x)") no_parser_error
compilation_context = updated_context
case .Error(let e):
errors =
if let errors = errors {
errors.append(error: e)
} else {
e
}
} }
} else {
let no_parser_error = ErrorWithLocation(
sourceLocation: specific_declaration_node.toSourceLocation(),
withError: "Could not find parser for declaration node"
)
errors =
if let errors = errors {
errors.append(error: no_parser_error)
} else {
no_parser_error
}
}
} }
} }