From 478ff4dae8cfdd53a76ad5db61bd427c6c6d6ee9 Mon Sep 17 00:00:00 2001 From: Axel Hecht Date: Wed, 6 Mar 2019 16:00:40 +0100 Subject: [PATCH] Remove Fluent 0.4 syntax support from fluent.syntax This is mostly code removal, and copying over the test fixtures from fluent.js/fluent-syntax. No modifications on those fixtures were needed. And then some test changes wrt to the '=' being required now. Where those tests exist in fluent.js, the results are equal. --- fluent.syntax/fluent/syntax/parser.py | 75 +--- fluent.syntax/fluent/syntax/stream.py | 9 - .../comment_continues_with_one_slash.ftl | 3 - .../entry_start_with_one_slash.ftl | 3 - .../section_starts_with_one_bracket.ftl | 2 - .../section_with_nl_in_the_middle.ftl | 4 - .../section_with_no_nl_after_it.ftl | 1 - .../section_with_one_bracket_at_the_end.ftl | 2 - .../standalone_identifier.ftl | 2 +- .../fixtures_structure/multiline_pattern.json | 370 +++++++++--------- .../syntax/fixtures_structure/section.ftl | 2 - .../syntax/fixtures_structure/section.json | 19 - .../section_with_comment.ftl | 2 - .../section_with_comment.json | 19 - .../fixtures_structure/syntax_zero_four.ftl | 6 - .../fixtures_structure/syntax_zero_four.json | 160 -------- fluent.syntax/tests/syntax/test_entry.py | 6 +- fluent.syntax/tests/syntax/test_equals.py | 8 +- fluent.syntax/tests/syntax/test_serializer.py | 24 -- 19 files changed, 196 insertions(+), 521 deletions(-) delete mode 100644 fluent.syntax/tests/syntax/fixtures_behavior/comment_continues_with_one_slash.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_behavior/entry_start_with_one_slash.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_behavior/section_starts_with_one_bracket.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_behavior/section_with_nl_in_the_middle.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_behavior/section_with_no_nl_after_it.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_behavior/section_with_one_bracket_at_the_end.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_structure/section.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_structure/section.json delete mode 100644 fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.json delete mode 100644 fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.ftl delete mode 100644 fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.json diff --git a/fluent.syntax/fluent/syntax/parser.py b/fluent.syntax/fluent/syntax/parser.py index 0fee34c2..ef43f5a2 100644 --- a/fluent.syntax/fluent/syntax/parser.py +++ b/fluent.syntax/fluent/syntax/parser.py @@ -63,16 +63,7 @@ def parse(self, source): # clear it. last_comment = None - if isinstance(entry, ast.Comment) \ - and ps.last_comment_zero_four_syntax \ - and len(entries) == 0: - comment = ast.ResourceComment(entry.content) - comment.span = entry.span - entries.append(comment) - else: - entries.append(entry) - - ps.last_comment_zero_four_syntax = False + entries.append(entry) res = ast.Resource(entries) @@ -131,12 +122,6 @@ def get_entry(self, ps): if ps.current_char == '#': return self.get_comment(ps) - if ps.current_char == '/': - return self.get_zero_four_style_comment(ps) - - if ps.current_char == '[': - return self.get_group_comment_from_section(ps) - if ps.current_char == '-': return self.get_term(ps) @@ -145,39 +130,6 @@ def get_entry(self, ps): raise ParseError('E0002') - @with_span - def get_zero_four_style_comment(self, ps): - ps.expect_char('/') - ps.expect_char('/') - ps.take_char(lambda x: x == ' ') - - content = '' - - while True: - ch = ps.take_char(lambda x: x != EOL) - while ch: - content += ch - ch = ps.take_char(lambda x: x != EOL) - - if ps.is_next_line_zero_four_comment(): - content += ps.current_char - ps.next() - ps.expect_char('/') - ps.expect_char('/') - ps.take_char(lambda x: x == ' ') - else: - break - - # Comments followed by Sections become GroupComments. - if ps.peek() == '[': - ps.skip_to_peek() - self.get_group_comment_from_section(ps) - return ast.GroupComment(content) - - ps.reset_peek() - ps.last_comment_zero_four_syntax = True - return ast.Comment(content) - @with_span def get_comment(self, ps): # 0 - comment @@ -216,34 +168,13 @@ def get_comment(self, ps): elif level == 2: return ast.ResourceComment(content) - @with_span - def get_group_comment_from_section(self, ps): - def until_closing_bracket_or_eol(ch): - return ch not in (']', EOL) - - ps.expect_char('[') - ps.expect_char('[') - while ps.take_char(until_closing_bracket_or_eol): - pass - ps.expect_char(']') - ps.expect_char(']') - - # A Section without a comment is like an empty Group Comment. - # Semantically it ends the previous group and starts a new one. - return ast.GroupComment('') - @with_span def get_message(self, ps): id = self.get_identifier(ps) ps.skip_blank_inline() + ps.expect_char('=') - # XXX Syntax 0.4 compat - if ps.current_char == '=': - ps.next() - value = self.maybe_get_pattern(ps) - else: - value = None - + value = self.maybe_get_pattern(ps) attrs = self.get_attributes(ps) if value is None and len(attrs) == 0: diff --git a/fluent.syntax/fluent/syntax/stream.py b/fluent.syntax/fluent/syntax/stream.py index 161b40f6..1f3852c8 100644 --- a/fluent.syntax/fluent/syntax/stream.py +++ b/fluent.syntax/fluent/syntax/stream.py @@ -64,7 +64,6 @@ def skip_to_peek(self): class FluentParserStream(ParserStream): - last_comment_zero_four_syntax = False def peek_blank_inline(self): start = self.index + self.peek_offset @@ -186,14 +185,6 @@ def is_value_continuation(self): return False - def is_next_line_zero_four_comment(self): - if self.current_peek != EOL: - return False - - is_comment = (self.peek(), self.peek()) == ('/', '/') - self.reset_peek() - return is_comment - # -1 - any # 0 - comment # 1 - group comment diff --git a/fluent.syntax/tests/syntax/fixtures_behavior/comment_continues_with_one_slash.ftl b/fluent.syntax/tests/syntax/fixtures_behavior/comment_continues_with_one_slash.ftl deleted file mode 100644 index fb2363aa..00000000 --- a/fluent.syntax/tests/syntax/fixtures_behavior/comment_continues_with_one_slash.ftl +++ /dev/null @@ -1,3 +0,0 @@ -// This is a normal comment -/ but this is not -# ~ERROR E0003, pos 29, args "/" diff --git a/fluent.syntax/tests/syntax/fixtures_behavior/entry_start_with_one_slash.ftl b/fluent.syntax/tests/syntax/fixtures_behavior/entry_start_with_one_slash.ftl deleted file mode 100644 index 2f32fa99..00000000 --- a/fluent.syntax/tests/syntax/fixtures_behavior/entry_start_with_one_slash.ftl +++ /dev/null @@ -1,3 +0,0 @@ - -/ Test -# ~ERROR E0003, pos 2, args "/" diff --git a/fluent.syntax/tests/syntax/fixtures_behavior/section_starts_with_one_bracket.ftl b/fluent.syntax/tests/syntax/fixtures_behavior/section_starts_with_one_bracket.ftl deleted file mode 100644 index 5c6ca574..00000000 --- a/fluent.syntax/tests/syntax/fixtures_behavior/section_starts_with_one_bracket.ftl +++ /dev/null @@ -1,2 +0,0 @@ -[ This is a broken section ]] -# ~ERROR E0003, pos 1, args "[" diff --git a/fluent.syntax/tests/syntax/fixtures_behavior/section_with_nl_in_the_middle.ftl b/fluent.syntax/tests/syntax/fixtures_behavior/section_with_nl_in_the_middle.ftl deleted file mode 100644 index 899ef512..00000000 --- a/fluent.syntax/tests/syntax/fixtures_behavior/section_with_nl_in_the_middle.ftl +++ /dev/null @@ -1,4 +0,0 @@ -[[ This is -a broken section]] -# ~ERROR E0003, pos 10, args "]" -# ~ERROR E0005, pos 13, args "a" diff --git a/fluent.syntax/tests/syntax/fixtures_behavior/section_with_no_nl_after_it.ftl b/fluent.syntax/tests/syntax/fixtures_behavior/section_with_no_nl_after_it.ftl deleted file mode 100644 index a26fcdf2..00000000 --- a/fluent.syntax/tests/syntax/fixtures_behavior/section_with_no_nl_after_it.ftl +++ /dev/null @@ -1 +0,0 @@ -[[ This is a correct section ]] \ No newline at end of file diff --git a/fluent.syntax/tests/syntax/fixtures_behavior/section_with_one_bracket_at_the_end.ftl b/fluent.syntax/tests/syntax/fixtures_behavior/section_with_one_bracket_at_the_end.ftl deleted file mode 100644 index 22ccf6fe..00000000 --- a/fluent.syntax/tests/syntax/fixtures_behavior/section_with_one_bracket_at_the_end.ftl +++ /dev/null @@ -1,2 +0,0 @@ -[[ This is a broken section ] -# ~ERROR E0003, pos 29, args "]" diff --git a/fluent.syntax/tests/syntax/fixtures_behavior/standalone_identifier.ftl b/fluent.syntax/tests/syntax/fixtures_behavior/standalone_identifier.ftl index 59e93157..859c579e 100644 --- a/fluent.syntax/tests/syntax/fixtures_behavior/standalone_identifier.ftl +++ b/fluent.syntax/tests/syntax/fixtures_behavior/standalone_identifier.ftl @@ -1,2 +1,2 @@ foo -# ~ERROR E0005, pos 3, args "foo" +# ~ERROR E0003, pos 3, args "=" diff --git a/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json b/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json index 03c51cf3..8f5c7fad 100644 --- a/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json +++ b/fluent.syntax/tests/syntax/fixtures_structure/multiline_pattern.json @@ -1,250 +1,250 @@ { + "type": "Resource", "body": [ { - "comment": null, - "span": { - "start": 0, - "end": 33, - "type": "Span" - }, - "attributes": [], - "type": "Message", + "type": "Message", "id": { - "type": "Identifier", + "type": "Identifier", + "name": "key01", "span": { - "start": 0, - "end": 5, - "type": "Span" - }, - "name": "key01" - }, + "type": "Span", + "start": 0, + "end": 5 + } + }, "value": { - "type": "Pattern", + "type": "Pattern", "elements": [ { - "type": "TextElement", + "type": "TextElement", + "value": "Value\nContinued here.", "span": { - "start": 8, - "end": 33, - "type": "Span" - }, - "value": "Value\nContinued here." + "type": "Span", + "start": 8, + "end": 33 + } } - ], + ], "span": { - "start": 8, - "end": 33, - "type": "Span" + "type": "Span", + "start": 8, + "end": 33 } + }, + "attributes": [], + "comment": null, + "span": { + "type": "Span", + "start": 0, + "end": 33 } - }, + }, { - "comment": null, - "span": { - "start": 35, - "end": 72, - "type": "Span" - }, - "attributes": [], - "type": "Message", + "type": "Message", "id": { - "type": "Identifier", + "type": "Identifier", + "name": "key02", "span": { - "start": 35, - "end": 40, - "type": "Span" - }, - "name": "key02" - }, + "type": "Span", + "start": 35, + "end": 40 + } + }, "value": { - "type": "Pattern", + "type": "Pattern", "elements": [ { - "type": "TextElement", + "type": "TextElement", + "value": "Value\nContinued here.", "span": { - "start": 47, - "end": 72, - "type": "Span" - }, - "value": "Value\nContinued here." + "type": "Span", + "start": 47, + "end": 72 + } } - ], + ], "span": { - "start": 43, - "end": 72, - "type": "Span" + "type": "Span", + "start": 43, + "end": 72 } + }, + "attributes": [], + "comment": null, + "span": { + "type": "Span", + "start": 35, + "end": 72 } - }, + }, { - "comment": { - "content": "ERROR \"Continued\" looks like a new message.\nkey03 parses fine with just \"Value\".", - "type": "Comment", - "span": { - "start": 74, - "end": 158, - "type": "Span" - } - }, - "span": { - "start": 74, - "end": 176, - "type": "Span" - }, - "attributes": [], - "type": "Message", + "type": "Message", "id": { - "type": "Identifier", + "type": "Identifier", + "name": "key03", "span": { - "start": 159, - "end": 164, - "type": "Span" - }, - "name": "key03" - }, + "type": "Span", + "start": 159, + "end": 164 + } + }, "value": { - "type": "Pattern", + "type": "Pattern", "elements": [ { - "type": "TextElement", + "type": "TextElement", + "value": "Value", "span": { - "start": 171, - "end": 176, - "type": "Span" - }, - "value": "Value" + "type": "Span", + "start": 171, + "end": 176 + } } - ], + ], "span": { - "start": 167, - "end": 176, - "type": "Span" + "type": "Span", + "start": 167, + "end": 176 } + }, + "attributes": [], + "comment": { + "type": "Comment", + "content": "ERROR \"Continued\" looks like a new message.\nkey03 parses fine with just \"Value\".", + "span": { + "type": "Span", + "start": 74, + "end": 158 + } + }, + "span": { + "type": "Span", + "start": 74, + "end": 176 } - }, + }, { - "content": "Continued here\n and here.\n\n", - "type": "Junk", - "span": { - "start": 177, - "end": 207, - "type": "Span" - }, + "type": "Junk", "annotations": [ { - "type": "Annotation", - "message": "Expected message \"Continued\" to have a value or attributes", - "code": "E0005", - "span": { - "start": 187, - "end": 187, - "type": "Span" - }, + "type": "Annotation", + "code": "E0003", "args": [ - "Continued" - ] - } - ] - }, - { - "comment": { - "content": "ERROR \"Continued\" and \"and\" look like new messages\nkey04 parses fine with just \"Value\".", - "type": "Comment", - "span": { - "start": 207, - "end": 298, - "type": "Span" + "=" + ], + "message": "Expected token: \"=\"", + "span": { + "type": "Span", + "start": 187, + "end": 187 + } } - }, + ], + "content": "Continued here\n and here.\n\n", "span": { - "start": 207, - "end": 316, - "type": "Span" - }, - "attributes": [], - "type": "Message", + "type": "Span", + "start": 177, + "end": 207 + } + }, + { + "type": "Message", "id": { - "type": "Identifier", + "type": "Identifier", + "name": "key04", "span": { - "start": 299, - "end": 304, - "type": "Span" - }, - "name": "key04" - }, + "type": "Span", + "start": 299, + "end": 304 + } + }, "value": { - "type": "Pattern", + "type": "Pattern", "elements": [ { - "type": "TextElement", + "type": "TextElement", + "value": "Value", "span": { - "start": 311, - "end": 316, - "type": "Span" - }, - "value": "Value" + "type": "Span", + "start": 311, + "end": 316 + } } - ], + ], "span": { - "start": 307, - "end": 316, - "type": "Span" + "type": "Span", + "start": 307, + "end": 316 } + }, + "attributes": [], + "comment": { + "type": "Comment", + "content": "ERROR \"Continued\" and \"and\" look like new messages\nkey04 parses fine with just \"Value\".", + "span": { + "type": "Span", + "start": 207, + "end": 298 + } + }, + "span": { + "type": "Span", + "start": 207, + "end": 316 } - }, + }, { - "content": "Continued here\n", - "type": "Junk", - "span": { - "start": 317, - "end": 332, - "type": "Span" - }, + "type": "Junk", "annotations": [ { - "type": "Annotation", - "message": "Expected message \"Continued\" to have a value or attributes", - "code": "E0005", - "span": { - "start": 327, - "end": 327, - "type": "Span" - }, + "type": "Annotation", + "code": "E0003", "args": [ - "Continued" - ] + "=" + ], + "message": "Expected token: \"=\"", + "span": { + "type": "Span", + "start": 327, + "end": 327 + } } - ] - }, - { - "content": "and even here.\n", - "type": "Junk", + ], + "content": "Continued here\n", "span": { - "start": 332, - "end": 347, - "type": "Span" - }, + "type": "Span", + "start": 317, + "end": 332 + } + }, + { + "type": "Junk", "annotations": [ { - "type": "Annotation", - "message": "Expected message \"and\" to have a value or attributes", - "code": "E0005", - "span": { - "start": 336, - "end": 336, - "type": "Span" - }, + "type": "Annotation", + "code": "E0003", "args": [ - "and" - ] + "=" + ], + "message": "Expected token: \"=\"", + "span": { + "type": "Span", + "start": 336, + "end": 336 + } } - ] + ], + "content": "and even here.\n", + "span": { + "type": "Span", + "start": 332, + "end": 347 + } } - ], - "type": "Resource", + ], "span": { - "start": 0, - "end": 347, - "type": "Span" + "type": "Span", + "start": 0, + "end": 347 } } diff --git a/fluent.syntax/tests/syntax/fixtures_structure/section.ftl b/fluent.syntax/tests/syntax/fixtures_structure/section.ftl deleted file mode 100644 index 60a26d32..00000000 --- a/fluent.syntax/tests/syntax/fixtures_structure/section.ftl +++ /dev/null @@ -1,2 +0,0 @@ - -[[ This is a section ]] diff --git a/fluent.syntax/tests/syntax/fixtures_structure/section.json b/fluent.syntax/tests/syntax/fixtures_structure/section.json deleted file mode 100644 index 989f27f3..00000000 --- a/fluent.syntax/tests/syntax/fixtures_structure/section.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "Resource", - "body": [ - { - "type": "GroupComment", - "content": "", - "span": { - "type": "Span", - "start": 1, - "end": 24 - } - } - ], - "span": { - "type": "Span", - "start": 0, - "end": 25 - } -} diff --git a/fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.ftl b/fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.ftl deleted file mode 100644 index 0174b68b..00000000 --- a/fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.ftl +++ /dev/null @@ -1,2 +0,0 @@ -// Comment -[[ Section ]] diff --git a/fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.json b/fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.json deleted file mode 100644 index 398f9e41..00000000 --- a/fluent.syntax/tests/syntax/fixtures_structure/section_with_comment.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "Resource", - "body": [ - { - "type": "GroupComment", - "content": "Comment", - "span": { - "type": "Span", - "start": 0, - "end": 24 - } - } - ], - "span": { - "type": "Span", - "start": 0, - "end": 25 - } -} diff --git a/fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.ftl b/fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.ftl deleted file mode 100644 index 2bf51ae7..00000000 --- a/fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.ftl +++ /dev/null @@ -1,6 +0,0 @@ -key1 - .attr1 = Attr 1 - -key2 - .attr1 = Attr 1 - .attr2 = Attr 2 diff --git a/fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.json b/fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.json deleted file mode 100644 index eef2f7a8..00000000 --- a/fluent.syntax/tests/syntax/fixtures_structure/syntax_zero_four.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "type": "Resource", - "body": [ - { - "type": "Message", - "id": { - "type": "Identifier", - "name": "key1", - "span": { - "type": "Span", - "start": 0, - "end": 4 - } - }, - "value": null, - "attributes": [ - { - "type": "Attribute", - "id": { - "type": "Identifier", - "name": "attr1", - "span": { - "type": "Span", - "start": 10, - "end": 15 - } - }, - "value": { - "type": "Pattern", - "elements": [ - { - "type": "TextElement", - "value": "Attr 1", - "span": { - "type": "Span", - "start": 18, - "end": 24 - } - } - ], - "span": { - "type": "Span", - "start": 18, - "end": 24 - } - }, - "span": { - "type": "Span", - "start": 9, - "end": 24 - } - } - ], - "comment": null, - "span": { - "type": "Span", - "start": 0, - "end": 24 - } - }, - { - "type": "Message", - "id": { - "type": "Identifier", - "name": "key2", - "span": { - "type": "Span", - "start": 26, - "end": 30 - } - }, - "value": null, - "attributes": [ - { - "type": "Attribute", - "id": { - "type": "Identifier", - "name": "attr1", - "span": { - "type": "Span", - "start": 36, - "end": 41 - } - }, - "value": { - "type": "Pattern", - "elements": [ - { - "type": "TextElement", - "value": "Attr 1", - "span": { - "type": "Span", - "start": 44, - "end": 50 - } - } - ], - "span": { - "type": "Span", - "start": 44, - "end": 50 - } - }, - "span": { - "type": "Span", - "start": 35, - "end": 50 - } - }, - { - "type": "Attribute", - "id": { - "type": "Identifier", - "name": "attr2", - "span": { - "type": "Span", - "start": 56, - "end": 61 - } - }, - "value": { - "type": "Pattern", - "elements": [ - { - "type": "TextElement", - "value": "Attr 2", - "span": { - "type": "Span", - "start": 64, - "end": 70 - } - } - ], - "span": { - "type": "Span", - "start": 64, - "end": 70 - } - }, - "span": { - "type": "Span", - "start": 55, - "end": 70 - } - } - ], - "comment": null, - "span": { - "type": "Span", - "start": 26, - "end": 70 - } - } - ], - "span": { - "type": "Span", - "start": 0, - "end": 71 - } -} diff --git a/fluent.syntax/tests/syntax/test_entry.py b/fluent.syntax/tests/syntax/test_entry.py index 434ac7b3..c1eae253 100644 --- a/fluent.syntax/tests/syntax/test_entry.py +++ b/fluent.syntax/tests/syntax/test_entry.py @@ -87,9 +87,9 @@ def test_return_junk(self): "content": "junk\n", "annotations": [ { - "args": ["junk"], - "code": "E0005", - "message": "Expected message \"junk\" to have a value or attributes", + "args": ["="], + "code": "E0003", + "message": "Expected token: \"=\"", "span": { "end": 23, "start": 23, diff --git a/fluent.syntax/tests/syntax/test_equals.py b/fluent.syntax/tests/syntax/test_equals.py index f70546ab..981c4d13 100644 --- a/fluent.syntax/tests/syntax/test_equals.py +++ b/fluent.syntax/tests/syntax/test_equals.py @@ -55,7 +55,7 @@ def test_same_complex_placeable_message(self): def test_same_message_with_attribute(self): message1 = self.parse_ftl_entry("""\ - foo + foo = .attr = Attr """) @@ -65,7 +65,7 @@ def test_same_message_with_attribute(self): def test_same_message_with_attributes(self): message1 = self.parse_ftl_entry("""\ - foo + foo = .attr1 = Attr 1 .attr2 = Attr 2 """) @@ -93,12 +93,12 @@ def parse_ftl_entry(self, string): def test_attributes(self): message1 = self.parse_ftl_entry("""\ - foo + foo = .attr1 = Attr1 .attr2 = Attr2 """) message2 = self.parse_ftl_entry("""\ - foo + foo = .attr2 = Attr2 .attr1 = Attr1 """) diff --git a/fluent.syntax/tests/syntax/test_serializer.py b/fluent.syntax/tests/syntax/test_serializer.py index 57c8cd6a..6c9c1f7e 100644 --- a/fluent.syntax/tests/syntax/test_serializer.py +++ b/fluent.syntax/tests/syntax/test_serializer.py @@ -154,17 +154,6 @@ def test_multiline_with_placeable(self): """ self.assertEqual(self.pretty_ftl(input), dedent_ftl(input)) - def test_attribute_syntax_zero_four(self): - input = """\ - foo - .attr = Foo Attr - """ - output = """\ - foo = - .attr = Foo Attr - """ - self.assertEqual(self.pretty_ftl(input), dedent_ftl(output)) - def test_attribute(self): input = """\ foo = @@ -181,19 +170,6 @@ def test_attribute_multiline(self): """ self.assertEqual(self.pretty_ftl(input), dedent_ftl(input)) - def test_two_attributes_syntax_zero_four(self): - input = """\ - foo - .attr-a = Foo Attr A - .attr-b = Foo Attr B - """ - output = """\ - foo = - .attr-a = Foo Attr A - .attr-b = Foo Attr B - """ - self.assertEqual(self.pretty_ftl(input), dedent_ftl(output)) - def test_two_attributes(self): input = """\ foo =