Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions maldoca/astgen/ast_def.cc
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ absl::StatusOr<AstDef> AstDef::FromProto(const AstDefPb &pb) {
&node, [](NodeDef *node) { return node->children_; });
}

// Set leafs vector.
// Set leaves vector.
for (const std::string &name : node_names) {
NodeDef &node = *nodes.at(name);

for (NodeDef *descendent : node.descendants_) {
if (!descendent->children().empty()) {
continue;
}
node.leafs_.push_back(descendent);
node.leaves_.push_back(descendent);
}
}

Expand Down Expand Up @@ -518,7 +518,7 @@ absl::StatusOr<AstDef> AstDef::FromProto(const AstDefPb &pb) {
}

std::vector<EnumMemberDef> type_enum_members;
for (const NodeDef *leaf : node->leafs()) {
for (const NodeDef *leaf : node->leaves()) {
EnumMemberDef member{Symbol(leaf->name()), leaf->name()};
type_enum_members.push_back(std::move(member));
}
Expand Down
4 changes: 2 additions & 2 deletions maldoca/astgen/ast_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class NodeDef {
absl::Span<const NodeDef* const> descendants() const { return descendants_; }

// All descendants that are leaf classes.
absl::Span<const NodeDef* const> leafs() const { return leafs_; }
absl::Span<const NodeDef* const> leaves() const { return leaves_; }

std::optional<const EnumDef*> node_type_enum() const {
if (node_type_enum_.has_value()) {
Expand Down Expand Up @@ -286,7 +286,7 @@ class NodeDef {
std::vector<FieldDef*> aggregated_fields_;
std::vector<NodeDef*> children_;
std::vector<NodeDef*> descendants_;
std::vector<NodeDef*> leafs_;
std::vector<NodeDef*> leaves_;
std::optional<EnumDef> node_type_enum_;
bool should_generate_ir_op_;
std::vector<FieldKind> kinds_;
Expand Down
4 changes: 2 additions & 2 deletions maldoca/astgen/ast_from_json_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ void AstFromJsonPrinter::PrintTypeChecker(const NodeDef& node) {
)cc");
Println(code);

if (!node.leafs().empty()) {
if (!node.leaves().empty()) {
Println(
"static const auto *kTypes = new absl::flat_hash_set<std::string>{");
{
auto indent = WithIndent(4);
for (const NodeDef* leaf : node.leafs()) {
for (const NodeDef* leaf : node.leaves()) {
auto vars = WithVars({
{"LeafType", leaf->name()},
});
Expand Down
2 changes: 1 addition & 1 deletion maldoca/astgen/ast_to_ir_source_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void AstToIrSourcePrinter::PrintNonLeafNode(const AstDef& ast,
"*node) {");
{
auto indent = WithIndent();
for (const NodeDef* leaf : node.leafs()) {
for (const NodeDef* leaf : node.leaves()) {
auto vars = WithVars({
{"LeafName", (Symbol(ast.lang_name()) + leaf->name()).ToPascalCase()},
{"leaf_name", Symbol(leaf->name()).ToCcVarName()},
Expand Down
2 changes: 1 addition & 1 deletion maldoca/astgen/ast_to_ir_source_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class AstToIrSourcePrinter : public CcPrinterBase {
//
// "ast.generated.h" is in that directory.
//
// This is used to print the #inclueds.
// This is used to print the #includes.
//
// - ir_path: The directory for the IR code.
//
Expand Down
2 changes: 1 addition & 1 deletion maldoca/astgen/ir_to_ast_source_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void IrToAstSourcePrinter::PrintNonLeafNode(const AstDef& ast,
Println("return llvm::TypeSwitch<$BaseName$, Ret>($name$)");
{
auto indent = WithIndent();
for (const NodeDef* leaf : node.leafs()) {
for (const NodeDef* leaf : node.leaves()) {
auto vars = WithVars({
{"LeafOpName",
leaf->ir_op_name(ast.lang_name(), kind)->ToPascalCase()},
Expand Down
2 changes: 1 addition & 1 deletion maldoca/js/babel/babel_internal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ message BabelResponse {
}

// Only contains the errors (if any) in the response.
// The AST is returned separatedly.
// The AST is returned separately.
message BabelParseResponse {
// Some errors are recoverable and/or are not severe enough to stop parsing.
//
Expand Down
2 changes: 1 addition & 1 deletion maldoca/js/quickjs_babel/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function convertCommentUidsToComments(ast) {
// =============================================================================

/**
* Replaces characteres in the range [U+D800, U+DFFF] with '�' (U+FFFD).
* Replaces characters in the range [U+D800, U+DFFF] with '�' (U+FFFD).
*
// copybara:strip_begin(internal comment)
* See: b/235090893.
Expand Down
Loading