Clojurians
#parinfer
<
2016-01-06
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

shaunlebron13:01:40

just published parinfer 1.4.0 to npm

shaunlebron13:01:44

2x speed improvements

shaunlebron13:01:59

~20ms to process 2800 lines

shaunlebron13:01:54

mode functions now return changedLines if you don’t want to overwrite the whole buffer everytime

shaunlebron13:01:24

and they also return an error object if you want to report the errors in the editor somewhere

shaunlebron13:01:07

code-wise, I did a lot of rewriting so it’s easier to compartmentalize what it’s doing, and it’s about 200 lines shorter

shaunlebron13:01:48

and I’m finally working on documenting the algorithm here: https://github.com/shaunlebron/parinfer/blob/master/lib/parinfer.js.md

shaunlebron13:01:05

apologies to the plugin authors, I expect it to stabilize after I anneal it a bit while writing docs on it

shaunlebron13:01:47

the api is of course stable, but for anyone trying to port the code, I recommend waiting on that until I finish the docs

cfleming23:01:40

@shaunlebron: Thanks for the update, I’ll wait a bit then

cfleming23:01:14

Is it possible to partially process files rather than having to do the whole thing?

cfleming23:01:56

i.e. from a particular change, can you work out how much of the file you need to process? I guess that would be different for indent and paren modes.

cfleming23:01:31

Indent should only require updating the top-level forms containing the changed lines I think, but paren mode changes might extend further.

darwin23:01:44

Marijn Haverberke of CodeMirror fame came up with the concept of "interruptable, resumable parser”, maybe something which could be applicable? read “A parser” section, http://codemirror.net/1/story.html#parser