sci_watch.parser.tree_node module

class sci_watch.parser.tree_node.Node(type: str, value: str, start_pos: int, end_pos: int, children: Optional[list[sci_watch.parser.tree_node.Node]] = None, search_scope: Optional[str] = None)[source]

Bases: object

Custom Node class used in replacement of Lark nodes

pretty(_indentation: str = '', query: str = '') str[source]

Pretty print method

Parameters:
  • _indentation (str) – Current indentation level

  • query (str) – Query raw string to be printed

Returns:

Pretty representation of the tree using indentations

Return type:

str