From 0afa62654d0d374719d432450bd5a755acbad622 Mon Sep 17 00:00:00 2001 From: James Westman Date: Wed, 24 Nov 2021 21:40:46 -0600 Subject: [PATCH] Fix error handling on keyword blocks Some blocks (menu, layout, etc) would emit an error if they didn't find an opening brace, which would fail if, for example, you had an object with ID "menu" and tried to use it as a property value. --- gtkblueprinttool/extensions/gtk_a11y.py | 2 +- gtkblueprinttool/extensions/gtk_layout.py | 2 +- gtkblueprinttool/extensions/gtk_menu.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtkblueprinttool/extensions/gtk_a11y.py b/gtkblueprinttool/extensions/gtk_a11y.py index 3d99655..d5ea1ad 100644 --- a/gtkblueprinttool/extensions/gtk_a11y.py +++ b/gtkblueprinttool/extensions/gtk_a11y.py @@ -164,7 +164,7 @@ a11y = Group( A11y, Sequence( Keyword("accessibility", True), - OpenBlock().expected("`{`"), + OpenBlock(), Until(a11y_prop, CloseBlock()), ) ) diff --git a/gtkblueprinttool/extensions/gtk_layout.py b/gtkblueprinttool/extensions/gtk_layout.py index 45195cc..65bc544 100644 --- a/gtkblueprinttool/extensions/gtk_layout.py +++ b/gtkblueprinttool/extensions/gtk_layout.py @@ -62,7 +62,7 @@ layout = Group( Layout, Sequence( Keyword("layout", True), - OpenBlock().expected("`{`"), + OpenBlock(), Until(layout_prop, CloseBlock()), ) ) diff --git a/gtkblueprinttool/extensions/gtk_menu.py b/gtkblueprinttool/extensions/gtk_menu.py index ecdc9c1..cc43bff 100644 --- a/gtkblueprinttool/extensions/gtk_menu.py +++ b/gtkblueprinttool/extensions/gtk_menu.py @@ -112,7 +112,7 @@ menu_item_shorthand = Group( ) menu_contents.children = [ - OpenBlock().expected("`{`"), + OpenBlock(), Until(AnyOf( menu_section, menu_submenu,