castl icon indicating copy to clipboard operation
castl copied to clipboard

Parinfer.js

Open gavlooth opened this issue 7 years ago • 4 comments

I am trying to compile parinfer.js to lua. I am newbie in lua but it seems to be something wrong with the implementation of the split method from js to lua ?

lua: TypeError: Cannot read property 'split' of undefined at (./castl/core_objects.lua:348) at __index (./castl/core_objects.lua:296) at getInitialResult (./parinfer-js.lua:95) at processText (./parinfer-js.lua:1075) at intentMode1 (./parinfer-js.lua:1152) at (out.lua:14) at ([C]:-1)

gavlooth avatar Dec 25 '17 16:12 gavlooth

Can you please provide a link to the exact Javascript file you have compiled? (exact source and version)

PaulBernier avatar Dec 25 '17 19:12 PaulBernier

No problem : https://github.com/shaunlebron/parinfer/blob/master/lib/parinfer.js I think that parinfer has zero dependencies, Downloaded with curl -O -L https://raw.githubusercontent.com/shaunlebron/parinfer/master/lib/parinfer.js

gavlooth avatar Dec 26 '17 06:12 gavlooth

Note that I did modifu the js file by unboxing the top level function in order to expose the API object.

gavlooth avatar Dec 26 '17 06:12 gavlooth

FYI - there is an implementation of the Parinfer core algorithm in Lua now: https://github.com/oakmac/parinfer-lua

cc @Gavlooth

oakmac avatar Feb 22 '21 18:02 oakmac