mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add dialog actions
This commit is contained in:
parent
bac008296a
commit
8ba898e354
10 changed files with 115 additions and 3 deletions
|
@ -47,6 +47,9 @@ class AstNode:
|
|||
self.tokens = ChainMap(tokens, defaultdict(lambda: None))
|
||||
self.incomplete = incomplete
|
||||
|
||||
self._unique_id: str | None = None
|
||||
self._next_unique_id: int = 0
|
||||
|
||||
self.parent = None
|
||||
for child in self.children:
|
||||
child.parent = self
|
||||
|
@ -71,6 +74,13 @@ class AstNode:
|
|||
else:
|
||||
return self.parent.parent_by_type(type)
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
if self._unique_id is None:
|
||||
self.root._next_unique_id += 1
|
||||
self._unique_id = "__" + str(self.root._next_unique_id)
|
||||
return self._unique_id
|
||||
|
||||
@lazy_prop
|
||||
def errors(self):
|
||||
return list(self._get_errors())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue