mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 08:30:10 +01:00
Checkpoint for a parser rewrite (#2364)
The intent of this approach is to eliminate recursion limits as a barrier for the parser. While it may not be urgent to address, I want to avoid pouring effort into a parser approach that we don't think will be usable long-term. Right now this is passing a minor set of tests. It's intended to be enough to show how I'm thinking about flow control for the parser. I'm manually switching back and forth because it seemed like the easiest approach that avoids duplicating tests.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "toolchain/lexer/token_kind.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
#include "toolchain/parser/parser2.h"
|
||||
#include "toolchain/parser/parser_impl.h"
|
||||
|
||||
namespace Carbon {
|
||||
@@ -27,6 +28,8 @@ auto ParseTree::Parse(TokenizedBuffer& tokens, DiagnosticConsumer& consumer)
|
||||
TokenDiagnosticEmitter emitter(translator, consumer);
|
||||
|
||||
// Delegate to the parser.
|
||||
// TODO: Edit this to swap between Parser and Parser2. This is manual in order
|
||||
// to avoid test duplication.
|
||||
return Parser::Parse(tokens, emitter);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user