the carriage return in this LAP file throws off the scanner.
262 constant define-key
263 varref map
264 constant "^M"
267 constant il-electric-return
270 call 3
271 discard
diff --git a/lapdecompile/main.py b/lapdecompile/main.py
index de0cd58..a4c029a 100755
--- a/lapdecompile/main.py
+++ b/lapdecompile/main.py
@@ -54,7 +54,7 @@ def control_flow(name, instructions, show_assembly, write_cfg):
def deparse(path, outstream, show_assembly, write_cfg, show_grammar, show_tree):
# Scan...
- with open(path, "r") as fp:
+ with open(path, "r", newline="\n") as fp:
scanner = LapScanner(fp, show_assembly=show_assembly)
pass
the carriage return in this LAP file throws off the scanner.
This seems to fix that but probably isn't so DOS friendly:
a similar change would go at the very bottom of
scanner.py