mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
WIP: List item factory syntax
This commit is contained in:
parent
3416546eac
commit
fdf91dc08e
10 changed files with 145 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue