mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 22:02:41 +01:00
Remove RuntimeError / CompilationError. (#2258)
Instead, work out the prefix for an error based on whether it was produced during parsing, semantic analysis, or when running the program.
This commit is contained in:
@@ -18,9 +18,9 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
auto ExecProgram(Nonnull<Arena*> arena, AST ast,
|
||||
std::optional<Nonnull<llvm::raw_ostream*>> trace_stream)
|
||||
-> ErrorOr<int> {
|
||||
auto AnalyzeProgram(Nonnull<Arena*> arena, AST ast,
|
||||
std::optional<Nonnull<llvm::raw_ostream*>> trace_stream)
|
||||
-> ErrorOr<AST> {
|
||||
if (trace_stream) {
|
||||
**trace_stream << "********** source program **********\n";
|
||||
for (const auto decl : ast.declarations) {
|
||||
@@ -54,6 +54,14 @@ auto ExecProgram(Nonnull<Arena*> arena, AST ast,
|
||||
for (const auto decl : ast.declarations) {
|
||||
**trace_stream << *decl;
|
||||
}
|
||||
}
|
||||
return ast;
|
||||
}
|
||||
|
||||
auto ExecProgram(Nonnull<Arena*> arena, AST ast,
|
||||
std::optional<Nonnull<llvm::raw_ostream*>> trace_stream)
|
||||
-> ErrorOr<int> {
|
||||
if (trace_stream) {
|
||||
**trace_stream << "********** starting execution **********\n";
|
||||
}
|
||||
return InterpProgram(ast, arena, trace_stream);
|
||||
|
||||
Reference in New Issue
Block a user