mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Make builder template factories use a subscope
This commit is contained in:
parent
a2eaaa26fe
commit
9dcd06de51
6 changed files with 46 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from ..parse_tree import Keyword
|
||||
from ..ast_utils import AstNode, validate
|
||||
from .common import *
|
||||
from .contexts import ScopeCtx
|
||||
|
||||
|
||||
class ListItemFactory(AstNode):
|
||||
|
@ -19,6 +21,14 @@ class ListItemFactory(AstNode):
|
|||
"sub-templates",
|
||||
)
|
||||
|
||||
@context(ScopeCtx)
|
||||
def scope_ctx(self) -> ScopeCtx:
|
||||
return ScopeCtx(node=self)
|
||||
|
||||
@validate()
|
||||
def unique_ids(self):
|
||||
self.context[ScopeCtx].validate_unique_ids()
|
||||
|
||||
@property
|
||||
def content(self) -> ObjectContent:
|
||||
return self.children[ObjectContent][0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue