jstolarek / slicer

Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
http://dl.acm.org/citation.cfm?id=3110258
GNU General Public License v3.0
6 stars 0 forks source link

Comments not allowed in REPL scripts #32

Open jstolarek opened 7 years ago

jstolarek commented 7 years ago

Comments in REPL scripts don't parse, unless they follow a legal expression. This requires some hackery to fix. At the moment loadFileToRepl has a hack to filter out empty lines. Perhaps it would make sense to add a fix there and drop those lines that contain only comments. That feels wrong though because it means duplicating parser logic outside of parser. An alternative would be to fix the REPL parser to accept comment-only lines and empty lines as well. The tricky part is that we currently assume that a successfully parsed line contains either a data declaration or an expression. I tried to return an empty data context when parsing a comment - in theory this should work but in practice it didn't and I don't have time to investigate further now.

jstolarek commented 7 years ago

I'm thinking the best way of fixing this is to drop the whole concept of "REPL scripts", ie. just fix #65.