mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 22:02:51 +01:00
Finish bracketing of parse nodes. (#2430)
- Finishes remaining "todo" parse nodes. - Improving error recovery for invalid designators and structs, so that the parse tree still looks similar to a valid parse tree. - Call expressions now have the thing being called as a child (of the start) instead of a sibling. - Use of Start is replacing use of End in several parse nodes, like structs and call expressions. - Adjusting documentation of parse node structures in an attempt to make it more consistent and understandable. - The current state for interfaces and if/else is mostly being documented, not altered.
This commit is contained in:
@@ -26,7 +26,7 @@ auto ParseTree::Parse(TokenizedBuffer& tokens, DiagnosticConsumer& consumer)
|
||||
// Delegate to the parser.
|
||||
auto tree = Parser::Parse(tokens, emitter);
|
||||
auto verify_error = tree.Verify();
|
||||
CARBON_CHECK(!verify_error) << *verify_error;
|
||||
CARBON_CHECK(!verify_error) << tree << *verify_error;
|
||||
return tree;
|
||||
}
|
||||
|
||||
@@ -215,11 +215,6 @@ auto ParseTree::Verify() const -> llvm::Optional<Error> {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (n_impl.kind.child_count() == ParseNodeKind::TodoFixParseNode) {
|
||||
while (subtree_size < n_impl.subtree_size && !nodes.empty()) {
|
||||
auto child_impl = node_impls_[nodes.pop_back_val().index()];
|
||||
subtree_size += child_impl.subtree_size;
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < n_impl.kind.child_count(); ++i) {
|
||||
if (nodes.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user