mozilla / mentat

UNMAINTAINED A persistent, relational store inspired by Datomic and DataScript.
https://mozilla.github.io/mentat/
Apache License 2.0
1.65k stars 115 forks source link

[cli] Handle line comments in EDN input #759

Closed ncalexan closed 6 years ago

ncalexan commented 6 years ago

Right, now the REPL glues together input lines with spaces, like a + " " + b. The problem is that when a contains a line comment, like

.q [:find ?e ?a ?v ; but not ?tx

then with the followup line

.q [:find ?e ?a ?v ; but not ?tx
     :where [?e ?a ?v]]

the glued line appears like

.q [:find ?e ?a ?v ; but not ?tx      :where [?e ?a ?v]]

Such lines will never be valid EDN input.

The solution is simple: glue with a + "\n" + b (which will also preserve newlines in multi-line strings).

ncalexan commented 6 years ago

Addressed by https://github.com/mozilla/mentat/commit/8e2d79577824f972ae13cf7ffb1c922e768a3340.