Fix bindings with no flags

This commit is contained in:
James Westman 2021-11-24 14:12:37 -06:00
parent 2a18273c80
commit 3f55aae7de
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
3 changed files with 6 additions and 3 deletions

View file

@ -74,10 +74,10 @@ def parse(tokens) -> T.Tuple[ast.UI, T.Optional[MultipleErrors]]:
UseIdent("bind_source").expected("the ID of a source object to bind from"), UseIdent("bind_source").expected("the ID of a source object to bind from"),
Op("."), Op("."),
UseIdent("bind_property").expected("a property name to bind from"), UseIdent("bind_property").expected("a property name to bind from"),
AnyOf( ZeroOrMore(AnyOf(
Sequence(Keyword("sync-create"), UseLiteral("sync_create", True)), Sequence(Keyword("sync-create"), UseLiteral("sync_create", True)),
Sequence(Keyword("after"), UseLiteral("after", True)), Sequence(Keyword("after"), UseLiteral("after", True)),
), )),
) )
) )

View file

@ -2,6 +2,8 @@ using Gtk 4.0;
Box { Box {
visible: bind box2.visible sync-create; visible: bind box2.visible sync-create;
orientation: bind box2.orientation;
} }
Box box2 {} Box box2 {
}

View file

@ -3,6 +3,7 @@
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="GtkBox"> <object class="GtkBox">
<property name="visible" bind-source="box2" bind-property="visible" bind-flags="sync-create"/> <property name="visible" bind-source="box2" bind-property="visible" bind-flags="sync-create"/>
<property name="orientation" bind-source="box2" bind-property="orientation"/>
</object> </object>
<object class="GtkBox" id="box2"></object> <object class="GtkBox" id="box2"></object>
</interface> </interface>