Parsing, semantic analysis, and lowering for and, or, not. (#2897)

Lowering for `and` and `or` is not yet complete because `Branch` lowering isn't done yet.
This commit is contained in:
Richard Smith
2023-06-14 13:03:13 -07:00
committed by GitHub
parent 8b1e820848
commit 06ce3b0161
28 changed files with 470 additions and 55 deletions
+5 -4
View File
@@ -310,12 +310,13 @@ auto ParseTree::Verify() const -> ErrorOr<Success> {
prev_index = n.index;
}
if (!has_errors_ &&
static_cast<int32_t>(node_impls_.size()) != tokens_->size()) {
if (!has_errors_ && static_cast<int32_t>(node_impls_.size()) !=
tokens_->expected_parse_tree_size()) {
return Error(
llvm::formatv("ParseTree has {0} nodes and no errors, but "
"TokenizedBuffer has {1} tokens.",
node_impls_.size(), tokens_->size()));
"TokenizedBuffer expected {1} nodes for {2} tokens.",
node_impls_.size(), tokens_->expected_parse_tree_size(),
tokens_->size()));
}
return Success();
}