Compiled Require
This compiler strives to emulate the native require method as accurately as possible, while exposing an api that allows modules to mutate imports
A compiler designed to compile multiple files into one with full lua support. Specifically for Tabletop Simulator
Also, due to the lack of a runtime, all paths have to be parsed by the compiler. (Though a custom compiler could be made to target a specific runtime) This means require statements must be passed a string literal. Alternatively, the file can use #include headers to specify paths to the compiler
Ideal compiler
- Can be decompiled with full accuracy
- For simplicity's sake, it would be nice to leave source intact
- require is always local to the contents of the file
- Obviously this isn't really 'perfect' - real require doesn't follow packages. But thats dumb. So we will.
- All require statements will resolve properly. string literal or not
- require statements found in the file will be used for discovery.
- It's not even close to practical to resolve require statements without string literals, so instead the compiler will provide a warning to allow the user to add it manually.
- This could be done with file headers like
--## require "os"