mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Separate output into its own module
This commit is contained in:
parent
8cf793023d
commit
a24f16109f
33 changed files with 407 additions and 291 deletions
|
@ -31,13 +31,6 @@ class Item(AstNode):
|
|||
def value_type(self):
|
||||
return StringType()
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
value = self.children[Value][0]
|
||||
attrs = value.attrs if isinstance(value, TranslatedStringValue) else {}
|
||||
xml.start_tag("item", **attrs)
|
||||
value.emit_xml(xml)
|
||||
xml.end_tag()
|
||||
|
||||
|
||||
class Strings(AstNode):
|
||||
grammar = [
|
||||
|
@ -55,12 +48,6 @@ class Strings(AstNode):
|
|||
def unique_in_parent(self):
|
||||
self.validate_unique_in_parent("Duplicate strings block")
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
xml.start_tag("items")
|
||||
for child in self.children:
|
||||
child.emit_xml(xml)
|
||||
xml.end_tag()
|
||||
|
||||
|
||||
@completer(
|
||||
applies_in=[ObjectContent],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue