Fixed comment handling in GCODE lines, escapes are no longer stripped
A good example while late night commits can sometimes be a bad idea.
This commit is contained in:
parent
fbca845bbd
commit
e79fd99a41
2 changed files with 4 additions and 4 deletions
|
|
@ -1846,7 +1846,7 @@ def strip_comment(line):
|
|||
for c in line:
|
||||
if c == ";" and not escaped:
|
||||
break
|
||||
result += c if c != "\\" or escaped else ""
|
||||
result += c
|
||||
escaped = (c == "\\") and not escaped
|
||||
return "".join(result)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ class TestCommHelpers(unittest.TestCase):
|
|||
@data(
|
||||
("M117 Test", "M117 Test"),
|
||||
("M117 Test ; foo", "M117 Test "),
|
||||
("M117 Test \\; foo", "M117 Test ; foo"),
|
||||
("M117 Test \\\\; foo", "M117 Test \\"),
|
||||
("M117 Test \\\\\\; foo", "M117 Test \\; foo"),
|
||||
("M117 Test \\; foo", "M117 Test \\; foo"),
|
||||
("M117 Test \\\\; foo", "M117 Test \\\\"),
|
||||
("M117 Test \\\\\\; foo", "M117 Test \\\\\\; foo"),
|
||||
("; foo", "")
|
||||
)
|
||||
@unpack
|
||||
|
|
|
|||
Loading…
Reference in a new issue