mkremins / flense

Edit trees, not text
MIT License
101 stars 3 forks source link

Preserve source-level constructs in opened files #3

Closed mkremins closed 10 years ago

mkremins commented 10 years ago

cljs.reader (which we're currently using to parse Clojure source files into EDN data structures before constructing a parse tree from the result) is not equipped to handle a number of valid Clojure syntactic constructs, including anonymous function shorthand. In addition, even existing Clojure readers that do support the full Clojure syntax must necessarily parse source files in a lossy way so as to convey structures like the deref shorthand (or, again, anonymous function shorthand) in data structure form.

To ensure that the relationship between the textual form of a Clojure source file and the same file's parse-tree representation within Flense is as close to a 1:1 correspondence as possible, we should implement and begin depending upon an alternative reader module that converts Clojure source directly to parse tree format. Such an alternative reader should preserve source-level constructs in Clojure source files as they are found, rather than attempting to normalize them for representation as roughly equivalent data structures.

Kovas Boguta's codn represents a step in the right direction in this regard, although I'm not sure if it's feasible for us to make use of codn directly.

mkremins commented 10 years ago

Closing this, since Flense itself no longer has any direct interaction with textual Clojure source code. Maybe this should be copied over to the flense-nw repo instead?