diff --git a/blueprintcompiler/language/adw_breakpoint.py b/blueprintcompiler/language/adw_breakpoint.py index 3d2c10d..4ad5b24 100644 --- a/blueprintcompiler/language/adw_breakpoint.py +++ b/blueprintcompiler/language/adw_breakpoint.py @@ -81,8 +81,8 @@ class AdwBreakpointSetter(AstNode): return self.tokens["property"] @property - def value(self) -> T.Optional[Value]: - return self.children[Value][0] if len(self.children[Value]) > 0 else None + def value(self) -> Value: + return self.children[Value][0] @property def gir_class(self) -> T.Optional[GirType]: @@ -106,10 +106,7 @@ class AdwBreakpointSetter(AstNode): return None @property - def document_symbol(self) -> T.Optional[DocumentSymbol]: - if self.value is None: - return None - + def document_symbol(self) -> DocumentSymbol: return DocumentSymbol( f"{self.object_id}.{self.property_name}", SymbolKind.Property, diff --git a/blueprintcompiler/outputs/xml/__init__.py b/blueprintcompiler/outputs/xml/__init__.py index 15850f7..5c03761 100644 --- a/blueprintcompiler/outputs/xml/__init__.py +++ b/blueprintcompiler/outputs/xml/__init__.py @@ -308,9 +308,6 @@ class XmlOutput(OutputFormat): elif isinstance(extension, AdwBreakpointSetters): for setter in extension.setters: - if setter.value is None: - continue - attrs = {} if isinstance(setter.value.child, Translated): diff --git a/blueprintcompiler/outputs/xml/xml_emitter.py b/blueprintcompiler/outputs/xml/xml_emitter.py index d34eff4..ea91e03 100644 --- a/blueprintcompiler/outputs/xml/xml_emitter.py +++ b/blueprintcompiler/outputs/xml/xml_emitter.py @@ -73,7 +73,6 @@ class XmlEmitter: self._needs_newline = False def put_cdata(self, text: str): - text = text.replace("]]>", "]]]]>") self.result += f"" self._needs_newline = False diff --git a/tests/samples/list_factory_nested.blp b/tests/samples/list_factory_nested.blp deleted file mode 100644 index 86a59b3..0000000 --- a/tests/samples/list_factory_nested.blp +++ /dev/null @@ -1,17 +0,0 @@ -using Gtk 4.0; - -Gtk.ListView { - factory: Gtk.BuilderListItemFactory list_item_factory { - template ListItem { - child: Gtk.ListView { - factory: Gtk.BuilderListItemFactory list_item_factory { - template ListItem { - child: Gtk.Label { - label: bind template.item as <$MyObject>.name; - }; - } - }; - }; - } - }; -} diff --git a/tests/samples/list_factory_nested.ui b/tests/samples/list_factory_nested.ui deleted file mode 100644 index 44cdb2b..0000000 --- a/tests/samples/list_factory_nested.ui +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - -]]> - - - - diff --git a/tests/samples/list_factory_nested_dec.blp b/tests/samples/list_factory_nested_dec.blp deleted file mode 100644 index 755491c..0000000 --- a/tests/samples/list_factory_nested_dec.blp +++ /dev/null @@ -1,18 +0,0 @@ -using Gtk 4.0; - -ListView { - factory: BuilderListItemFactory list_item_factory { - template ListItem { - child: ListView { - factory: BuilderListItemFactory list_item_factory { - template ListItem { - child: Label { - label: bind template.item as <$MyObject>.name; - }; - } - }; - }; - } - }; -} - diff --git a/tests/test_tokenizer.py b/tests/test_tokenizer.py index ad5f828..2bca595 100644 --- a/tests/test_tokenizer.py +++ b/tests/test_tokenizer.py @@ -25,7 +25,7 @@ from blueprintcompiler.tokenizer import Token, TokenType, tokenize class TestTokenizer(unittest.TestCase): - def assert_tokenize(self, string: str, expect: list[Token]): + def assert_tokenize(self, string: str, expect: [Token]): try: tokens = tokenize(string) self.assertEqual(len(tokens), len(expect))