Skip to content

Commit e881c0c

Browse files
committed
Trim trailing newline from Section spans
1 parent 354525c commit e881c0c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

fluent/syntax/parser.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def parse(self, source):
5050
else:
5151
entries.append(entry)
5252

53+
ps.skip_inline_ws()
5354
ps.skip_blank_lines()
5455

5556
res = ast.Resource(entries, comment)
@@ -147,10 +148,6 @@ def get_section(self, ps, comment):
147148
ps.expect_char(']')
148149
ps.expect_char(']')
149150

150-
ps.skip_inline_ws()
151-
152-
ps.expect_char('\n')
153-
154151
return ast.Section(symb, comment)
155152

156153
@with_span

tests/syntax/fixtures_structure/section.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"span": {
1818
"type": "Span",
1919
"start": 1,
20-
"end": 25
20+
"end": 24
2121
}
2222
}
2323
],

0 commit comments

Comments
 (0)