Commit Graph

30 Commits

Author SHA1 Message Date
Andy Weidenbaum
57492ba18f specify rust 2021 edition 2022-01-22 20:53:53 +11:00
Andy Weidenbaum
3daf079207 s/’/' to be more tty friendly 2022-01-19 20:20:46 +11:00
Andy Weidenbaum
a2a801e69d 2022 2022-01-12 17:56:13 +11:00
Andy Weidenbaum
6f6c6be1da fmt doc comments 2021-12-23 12:18:09 +11:00
Andy Weidenbaum
738b5b150f update readme example 2021-06-15 07:55:12 +10:00
Andy Weidenbaum
1bb9236f7b use Cow for d-r-y (Static...) 2021-06-15 07:28:46 +10:00
Andy Weidenbaum
10391c419a add FunctionLoader and StaticFunctionSearcher
an alternative to boxing closures
2021-05-12 21:07:22 +10:00
Andy Weidenbaum
76425c0aeb add StaticClosureSearcher
because evidently one does not merely accept `&'static str` OR `String`
2021-03-29 12:50:13 +11:00
Andy Weidenbaum
9d6faef3d3 ClosureSearcher.modules HashMap<String, ...> 2021-03-29 12:40:32 +11:00
Andy Weidenbaum
f816aeaf6b don't use rlua::prelude 2021-03-24 16:10:47 +11:00
Andy Weidenbaum
0b09ac03d6 prefer where syntax 2021-03-24 07:53:43 +11:00
Andy Weidenbaum
406c84dabf clean up ClosureSearcher api with hrtb
see
- https://stackoverflow.com/questions/35592750/how-does-for-syntax-differ-from-a-regular-lifetime-bound/35595491#35595491
- https://doc.rust-lang.org/nomicon/hrtb.html
2021-03-24 07:43:52 +11:00
Andy Weidenbaum
801a04802a implement ClosureSearcher
expose `UserData` created from Rust

manipulate the `rlua::Context` in Rust and return string to load as chunk

primarily intended to enable constructing Lua modules in Rust
- particularly Lua modules involving `UserData`
2021-03-23 14:43:56 +11:00
Andy Weidenbaum
dd283c2316 relicense under dual MIT/Apache scheme
see
- https://rust-lang.github.io/api-guidelines/necessities.html
2021-03-22 11:57:11 +11:00
Andy Weidenbaum
94ff5d143e stop converting relative paths to absolute
prevented downstream users from utilizing `PathSearcher` in binary
2021-03-15 11:19:48 +11:00
Andy Weidenbaum
33599cd9b6 s/Fennel/Lua and add note about &'static str keys 2021-03-08 10:01:52 +11:00
Andy Weidenbaum
53432900c1 s/PolySearcher/PathSearcherPoly, convert/transform
s/add_poly_searcher/add_path_searcher_poly
2021-03-04 12:22:40 +11:00
Andy Weidenbaum
278a3bb140 rearchitect PathSearcher as PolySearcher
to genericize conversion of paths to lua source code
- which facilitates module reloading for e.g.
  - fennel
  - teal
  - typescripttolua
2021-02-27 11:18:30 +11:00
Andy Weidenbaum
587dfbabe4 s/module_// 2021-02-27 09:17:14 +11:00
Andy Weidenbaum
8e25481811 import std::fs::File 2021-02-27 09:15:54 +11:00
Andy Weidenbaum
cf3a90faca implement PathSearcher
to facilitate module reloading
2021-02-26 20:59:46 +11:00
Andy Weidenbaum
a331b2bf8b re-fmt comments 2021-02-17 22:34:46 +11:00
Andy Weidenbaum
8c8bd29d0d prefer as_str()
credit
- https://www.fpcomplete.com/blog/avoiding-duplicating-strings-rust/
2021-02-15 11:40:48 +11:00
Andy Weidenbaum
4aa2f52dd7 index StaticSearcher &'static str by &'static str
credit
- https://stackoverflow.com/questions/65549983/trait-borrowstring-is-not-implemented-for-str/65550108#65550108
2021-02-15 11:33:45 +11:00
Andy Weidenbaum
f159a7cc27 implement add_static_searcher
to facilitate compile-time includes
2021-02-13 17:15:35 +11:00
Andy Weidenbaum
a7c9fbdba8 rm superfluous lifetime annotation 2021-02-04 15:30:06 +11:00
Andy Weidenbaum
d74b008050 s/RLua/Lua 2021-02-04 12:40:14 +11:00
Andy Weidenbaum
fbb1942093 rustfmt 2021-02-04 12:18:29 +11:00
Andy Weidenbaum
38c15af4dc make initial implementation
credit
- https://github.com/AlphaModder/include-lua
2021-02-04 12:16:07 +11:00
Andy Weidenbaum
187c5f55ea init 2021-02-04 11:09:05 +11:00