Skip to content

Commit

Permalink
Misc. cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
amomchilov authored and egiurleo committed Aug 22, 2024
1 parent 231448c commit 207c182
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions parser/prism/Translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,8 @@ std::unique_ptr<parser::Node> Translator::translate(pm_node_t *node) {
pm_location_t *declLoc = &classNode->class_keyword_loc;

auto name = translate(reinterpret_cast<pm_node *>(classNode->constant_path));
std::unique_ptr<parser::Node> superclass;
auto superclass = translate(classNode->superclass);

if (classNode->superclass != nullptr) {
superclass = translate(reinterpret_cast<pm_node *>(classNode->superclass));
}
auto body = translate(classNode->body);

return make_unique<parser::Class>(parser.translateLocation(loc), parser.translateLocation(declLoc),
Expand All @@ -151,7 +148,7 @@ std::unique_ptr<parser::Node> Translator::translate(pm_node_t *node) {
if (constantPathNode->parent) {
// This constant reference is chained onto another constant reference.
// E.g. if `node` is pointing to `B`, then then `A` is the `parent` in `A::B::C`.
parent = translate(reinterpret_cast<pm_node *>(constantPathNode->parent));
parent = translate(constantPathNode->parent);
} else { // This is a fully qualified constant reference, like `::A`.
pm_location_t *delimiterLoc = &constantPathNode->delimiter_loc; // The location of the `::`
parent = make_unique<parser::Cbase>(parser.translateLocation(delimiterLoc));
Expand Down

0 comments on commit 207c182

Please sign in to comment.