From 207c18229e4a163cfa0298407a195c603f02322b Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Thu, 22 Aug 2024 09:55:04 -0400 Subject: [PATCH] Misc. cleanup --- parser/prism/Translator.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/parser/prism/Translator.cc b/parser/prism/Translator.cc index 508bcb47c34..f57b2d29fc6 100644 --- a/parser/prism/Translator.cc +++ b/parser/prism/Translator.cc @@ -130,11 +130,8 @@ std::unique_ptr Translator::translate(pm_node_t *node) { pm_location_t *declLoc = &classNode->class_keyword_loc; auto name = translate(reinterpret_cast(classNode->constant_path)); - std::unique_ptr superclass; + auto superclass = translate(classNode->superclass); - if (classNode->superclass != nullptr) { - superclass = translate(reinterpret_cast(classNode->superclass)); - } auto body = translate(classNode->body); return make_unique(parser.translateLocation(loc), parser.translateLocation(declLoc), @@ -151,7 +148,7 @@ std::unique_ptr 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(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.translateLocation(delimiterLoc));