From 3f55aae7decf25cc3ef2678fca751ea129b09de4 Mon Sep 17 00:00:00 2001 From: James Westman Date: Wed, 24 Nov 2021 14:12:37 -0600 Subject: [PATCH] Fix bindings with no flags --- gtkblueprinttool/parser.py | 4 ++-- tests/samples/binding.blp | 4 +++- tests/samples/binding.ui | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gtkblueprinttool/parser.py b/gtkblueprinttool/parser.py index 4559fd6..9ac3fdf 100644 --- a/gtkblueprinttool/parser.py +++ b/gtkblueprinttool/parser.py @@ -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"), Op("."), UseIdent("bind_property").expected("a property name to bind from"), - AnyOf( + ZeroOrMore(AnyOf( Sequence(Keyword("sync-create"), UseLiteral("sync_create", True)), Sequence(Keyword("after"), UseLiteral("after", True)), - ), + )), ) ) diff --git a/tests/samples/binding.blp b/tests/samples/binding.blp index e4b4a88..af478fb 100644 --- a/tests/samples/binding.blp +++ b/tests/samples/binding.blp @@ -2,6 +2,8 @@ using Gtk 4.0; Box { visible: bind box2.visible sync-create; + orientation: bind box2.orientation; } -Box box2 {} +Box box2 { +} diff --git a/tests/samples/binding.ui b/tests/samples/binding.ui index 7d20e8c..14a74ac 100644 --- a/tests/samples/binding.ui +++ b/tests/samples/binding.ui @@ -3,6 +3,7 @@ +