castl
castl copied to clipboard
Fallback to functions _get and _set if types are unknown
Indexing and indexed assignment have slightly different semantics in JS vs Lua. This will also help with #3.
Instead of compiling a = foo.bar
to a = foo.bar
, it should instead compile to a = _get(foo, "bar")
.
I had an attempt at this locally, and got it working for indexing and for method calls, but not for assignment; i.e. for a.b = c
I got _get(a, "b") = c
which is invalid lua code. I think getting this right will require changes to all the compile{Assignment,Update}Expression*
functions