diff --git a/trlc/ast.py b/trlc/ast.py index 3c8168a..a187f13 100644 --- a/trlc/ast.py +++ b/trlc/ast.py @@ -3094,10 +3094,10 @@ def iter_record_objects_by_section(self): if location not in self.trlc_files: self.trlc_files.append(location) yield location - if record_object.section: - object_level = len(record_object.section) - 1 - else: - object_level = 0 + if record_object.section: + object_level = len(record_object.section) - 1 + else: + object_level = 0 if record_object.section: for level, section in enumerate(record_object.section): if section not in self.section_names: