mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add bind for bidirectional
This commit is contained in:
parent
6800601d94
commit
168b87bb4a
3 changed files with 5 additions and 0 deletions
|
@ -281,6 +281,8 @@ class Property(AstNode):
|
|||
bind_flags.append("sync-create")
|
||||
if self.tokens["after"]:
|
||||
bind_flags.append("after")
|
||||
if self.tokens["bidirectional"]:
|
||||
bind_flags.append("bidirectional")
|
||||
bind_flags_str = "|".join(bind_flags) or None
|
||||
|
||||
props = {
|
||||
|
|
|
@ -283,6 +283,8 @@ def decompile_property(ctx, gir, name, cdata, bind_source=None, bind_property=No
|
|||
flags += " sync-create"
|
||||
if "after" in bind_flags:
|
||||
flags += " after"
|
||||
if "bidirectional" in bind_flags:
|
||||
flags += " bidirectional"
|
||||
ctx.print(f"{name}: bind {bind_source}.{bind_property}{flags};")
|
||||
elif _truthy(translatable):
|
||||
if context is not None:
|
||||
|
|
|
@ -77,6 +77,7 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
|
|||
ZeroOrMore(AnyOf(
|
||||
Sequence(Keyword("sync-create"), UseLiteral("sync_create", True)),
|
||||
Sequence(Keyword("after"), UseLiteral("after", True)),
|
||||
Sequence(Keyword("bidirectional"), UseLiteral("bidirectional", True)),
|
||||
)),
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue