mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 02:20:29 +00:00
Fix parse to use the error tracking consumer for has_errors_. (#4261)
This is how we are setting has_errors_ in other stages; this should only make parse consistent. Fixes #4259
This commit is contained in:
1 parent
702d0d8a53
commit
b72826c431
13 files changed
+52
-57
No files matched your search
@@ -69,17 +69,11 @@ Context::Context(Tree& tree, Lex::TokenizedBuffer& tokens,
|
||||
auto Context::AddLeafNode(NodeKind kind, Lex::TokenIndex token, bool has_error)
|
||||
-> void {
|
||||
tree_->node_impls_.push_back(Tree::NodeImpl(kind, has_error, token));
|
||||
if (has_error) {
|
||||
tree_->has_errors_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
auto Context::AddNode(NodeKind kind, Lex::TokenIndex token, bool has_error)
|
||||
-> void {
|
||||
tree_->node_impls_.push_back(Tree::NodeImpl(kind, has_error, token));
|
||||
if (has_error) {
|
||||
tree_->has_errors_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
auto Context::ReplacePlaceholderNode(int32_t position, NodeKind kind,
|
||||
@@ -92,9 +86,6 @@ auto Context::ReplacePlaceholderNode(int32_t position, NodeKind kind,
|
||||
node_impl->kind = kind;
|
||||
node_impl->has_error = has_error;
|
||||
node_impl->token = token;
|
||||
if (has_error) {
|
||||
tree_->has_errors_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
auto Context::ConsumeAndAddOpenParen(Lex::TokenIndex default_token,
|
||||
|
||||
Reference in new issue
Block a user