Skip to content

Commit

Permalink
adds tracing for sections
Browse files Browse the repository at this point in the history
  • Loading branch information
christophkloeffel committed Oct 16, 2023
1 parent da14749 commit 39ead5a
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions trlc/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -2894,6 +2894,7 @@ def perform_checks(self, mh):


class Section(Entity):
# lobster-trace: LRM.Section_Declaration
"""A section for readability
This represents a section construct in TRLC files to group record
Expand All @@ -2909,13 +2910,11 @@ class Section(Entity):
"""
def __init__(self, name, location, parent):
# lobster-exclude: Constructor only declares variables
super().__init__(name, location)
assert isinstance(parent, Section) or parent is None
self.parent = parent

def dump(self, indent=0): # pragma: no cover
# lobster-exclude: Debugging feature
self.write_indent(indent, "Section %s" % self.name)
if self.parent is None:
self.write_indent(indent + 1, "Parent: None")
Expand Down
1 change: 1 addition & 0 deletions trlc/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,7 @@ def parse_check_block(self):
return n_check_block

def parse_section_declaration(self):
# lobster-trace: LRM.Section_Declaration
self.match_kw("section")
self.match("STRING")
if self.section:
Expand Down

0 comments on commit 39ead5a

Please sign in to comment.