mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Change template syntax
Templates now use a TypeName instead of an identifier, which makes it clearer that it's an extern symbol (or that it's a Gtk.ListItem).
This commit is contained in:
parent
aebf8be278
commit
04509e4b2e
31 changed files with 175 additions and 55 deletions
|
@ -57,6 +57,7 @@ class DecompileCtx:
|
|||
self._indent: int = 0
|
||||
self._blocks_need_end: T.List[str] = []
|
||||
self._last_line_type: LineType = LineType.NONE
|
||||
self.template_class: T.Optional[str] = None
|
||||
|
||||
self.gir.add_namespace(get_namespace("Gtk", "4.0"))
|
||||
|
||||
|
@ -158,6 +159,8 @@ class DecompileCtx:
|
|||
)
|
||||
):
|
||||
self.print(f'{name}: "{escape_quote(value)}";')
|
||||
elif value == self.template_class:
|
||||
self.print(f"{name}: template;")
|
||||
elif type.assignable_to(
|
||||
self.gir.namespaces["Gtk"].lookup_type("GObject.Object")
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue