File: node.py

package info (click to toggle)
python-pegen 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,148 kB
  • sloc: python: 15,081; makefile: 89
file content (13 lines) | stat: -rw-r--r-- 368 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
class Node:

    def __init__(self, type, children):
        self.type = type
        self.children = children

    def __repr__(self):
        return f"Node({self.type}, {self.children})"

    def __eq__(self, other):
        if not isinstance(other, Node):
            return NotImplemented
        return self.type == other.type and self.children == other.children