diff --git a/blueprintcompiler/language/values.py b/blueprintcompiler/language/values.py index 833a4a3..cb80975 100644 --- a/blueprintcompiler/language/values.py +++ b/blueprintcompiler/language/values.py @@ -225,12 +225,12 @@ class Flag(AstNode): return self.tokens["value"] @property - def value(self) -> T.Optional[str]: + def value(self) -> T.Optional[int]: type = self.context[ValueTypeCtx].value_type if not isinstance(type, Enumeration): return None elif member := type.members.get(self.name): - return member.nick + return member.value else: return None diff --git a/docs/collect-sections.py b/docs/collect-sections.py index 07bc5f6..e6227e7 100755 --- a/docs/collect-sections.py +++ b/docs/collect-sections.py @@ -132,8 +132,5 @@ if __name__ == "__main__": # print the sections to a json file with open(outfile, "w") as f: json.dump( - {name: section.to_json() for name, section in sections.items()}, - f, - indent=2, - sort_keys=True, + {name: section.to_json() for name, section in sections.items()}, f, indent=2 ) diff --git a/docs/index.rst b/docs/index.rst index a71b968..34b942c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,7 +26,7 @@ Blueprint is a markup language and compiler for GTK 4 user interfaces. using Gtk 4.0; - template $MyAppWindow: ApplicationWindow { + template MyAppWindow : ApplicationWindow { default-width: 600; default-height: 300; title: _("Hello, Blueprint!"); @@ -35,7 +35,7 @@ Blueprint is a markup language and compiler for GTK 4 user interfaces. HeaderBar {} Label { - label: bind template.main_text; + label: bind MyAppWindow.main_text; } } diff --git a/tests/samples/flags.ui b/tests/samples/flags.ui index 44eb2c4..2f0a26e 100644 --- a/tests/samples/flags.ui +++ b/tests/samples/flags.ui @@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler. - is-service|handles-open + 1|4 1