mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add ScopeCtx instead of root.objects_by_id
This allows us to introduce new scopes, such as in GtkBuilderListItemFactory templates.
This commit is contained in:
parent
ff5fff7f4b
commit
ec844b10ca
8 changed files with 65 additions and 40 deletions
|
@ -20,6 +20,7 @@
|
|||
import typing as T
|
||||
|
||||
from .gtkbuilder_template import Template
|
||||
from .contexts import ScopeCtx
|
||||
from .common import *
|
||||
|
||||
|
||||
|
@ -112,7 +113,7 @@ class Signal(AstNode):
|
|||
if object_id is None:
|
||||
return
|
||||
|
||||
if self.root.objects_by_id.get(object_id) is None:
|
||||
if self.context[ScopeCtx].objects.get(object_id) is None:
|
||||
raise CompileError(f"Could not find object with ID '{object_id}'")
|
||||
|
||||
@docs("name")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue