| Crates.io | lua_semantics |
| lib.rs | lua_semantics |
| version | 0.9.0 |
| created_at | 2024-09-16 05:16:47.296221+00 |
| updated_at | 2025-07-22 12:25:39.245313+00 |
| description | semantic analysis and enhanced AST converter for lua_parser crate |
| homepage | |
| repository | https://github.com/ehwan/lua_rust |
| max_upload_size | |
| id | 1376004 |
| size | 67,076 |
lua syntax parser & runtime interpreter in Rust
32bit: use 32bit integer and float for lua numeric typeclone this repository and simply run
$ cargo run <source_file.lua>
or
$ cargo run
will start lua REPL. Note that this executable is not cargo published.
add lua_ir crate to your Cargo.toml
[dependencies]
lua_ir = "..."
let mut env = lua_ir::LuaEnv::new();
env.eval_chunk( b"var_hello = 'Hello'" )?;
env.eval_chunk( b"var_world = 'World'" )?;
env.eval_chunk( b"print( var_hello .. ', ' .. var_world .. '!' )" )?;
// Hello, World!
let hello_value = env.get_global( "var_hello" )?;
let world_value = env.get_global( "var_world" )?;
env.set_global( "var_hello", 10.into() )?;