WIP: List item factory syntax

This commit is contained in:
James Westman 2022-07-18 16:37:15 -05:00
parent 3416546eac
commit fdf91dc08e
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
10 changed files with 145 additions and 9 deletions

View file

@ -21,6 +21,7 @@
from .expression import Expr
from .gobject_object import Object
from .gtkbuilder_template import Template
from .gtk_list_item_factory import ListItemFactory
from .values import Value, TranslatedStringValue
from .common import *
@ -30,7 +31,7 @@ class Property(AstNode):
[
UseIdent("name"),
":",
Keyword("bind"),
Keyword("bind-prop", "bind"),
UseIdent("bind_source"),
".",
UseIdent("bind_property"),
@ -46,7 +47,7 @@ class Property(AstNode):
UseIdent("name"),
UseLiteral("binding", True),
":",
"bind",
Keyword("bind"),
Expr,
),
Statement(
@ -162,6 +163,10 @@ class Property(AstNode):
xml.start_tag("property", **props)
self.children[Object][0].emit_xml(xml)
xml.end_tag()
elif len(self.children[ListItemFactory]) == 1:
xml.start_tag("property", **props)
self.children[ListItemFactory][0].emit_xml(xml)
xml.end_tag()
elif value is None:
if self.tokens["binding"]:
xml.start_tag("binding", **props)