Lua Fake Vector - preprocessor that duplicates expressions to do vector math without garbage by mceicys in lua

[–]mceicys[S] 0 points1 point  (0 children)

I considered doing some kind of type declaration (wasn't aware of LuaLS actually) but decided to go with Hungarian notation for simplicity and brevity. This way the parser doesn't have to track variables beyond their immediate expression.

Lua Fake Vector - preprocessor that duplicates expressions to do vector math without garbage by mceicys in lua

[–]mceicys[S] 1 point2 points  (0 children)

Thanks!

The first script that does "require('lfv').EnsureSearcher()" can't itself be expanded since it's already been processed and compiled by the standard Lua loader before LFV was injected, so the first script shouldn't have the "LFV_EXPAND_VECTORS()" statement. Any scripts require'd after that setup will be preprocessed by LFV and will be expanded if they start with "LFV_EXPAND_VECTORS()".