First : sorry if I am polluting the group with my questions.
Right now, when there is a syntax error like a parenthesis missing, shen will report
syntax error here:
...
it can be annoying when the file is long enough, and you don't know where the error is?
This happens because the global variable *residue* is not set anywhere, it is always empty.
one solution to the problem is to create a new compile function for bytes in reader.shen
I tested and it works, but of course maybe there is a better solution:
(define read-file
File -> (let Bytelist (read-file-as-bytelist File)
S-exprs (compileBytes (/. X (<s-exprs> X)) Bytelist)
Process (process-sexprs S-exprs)
Process))
(define compileBytes
F L -> (let Compile (F L)
(cases (parse-failure? Compile) (error "parse failure~%")
(cons? (in-> Compile)) (print-residue (in-> Compile))
true (<-out Compile))))