mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 12:11:04 +01:00
Remove global_arena (#814)
With this, only main.cpp instantiates an arena. Maybe we'll want to split that up more later (e.g., so that the runtime interpreter uses its own arena), but given the intent to have type-checking update the AST, I thought this was a reasonable approach for now in order to avoid ownership complexities. Fixes #769
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <variant>
|
||||
|
||||
#include "executable_semantics/ast/ast.h"
|
||||
#include "executable_semantics/common/arena.h"
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
@@ -16,8 +17,8 @@ namespace Carbon {
|
||||
using SyntaxErrorCode = int;
|
||||
|
||||
// Returns the AST representing the contents of the named file, or an error code
|
||||
// if parsing fails.
|
||||
auto Parse(const std::string& input_file_name)
|
||||
// if parsing fails. Allocations go into the provided arena.
|
||||
auto Parse(Ptr<Arena> arena, const std::string& input_file_name)
|
||||
-> std::variant<Carbon::AST, SyntaxErrorCode>;
|
||||
|
||||
} // namespace Carbon
|
||||
|
||||
Reference in New Issue
Block a user