Skip to content

Commit 42ce511

Browse files
authored
Merge pull request #738 from gerlero/parser
Improve newline handling in parser
2 parents e0d61b3 + adcbdd7 commit 42ce511

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/foamlib/_files/_parsing/_parser.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,10 @@ def _skip(
102102
pos += 1
103103
break
104104
if contents[pos] == ord("\\"):
105-
newline_next = False
106105
with contextlib.suppress(IndexError):
107-
newline_next = contents[pos + 1] == ord("\n")
108-
if not newline_next:
109-
raise FoamFileDecodeError(
110-
contents,
111-
pos,
112-
expected="end of line after backslash",
113-
)
114-
pos += 2
106+
if contents[pos + 1] == ord("\n"):
107+
pos += 1
108+
pos += 1
115109
continue
116110
pos += 1
117111
continue

0 commit comments

Comments
 (0)