Skip to content

Repository files navigation

lua_rust

crates.iodocs.rs

lua syntax parser & runtime interpreter in Rust

Cargo Features

  • 32bit: use 32bit integer and float for lua numeric type

How to use

As REPL interpreter

clone 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.

As Library

add lua_ir crate to your Cargo.toml

[dependencies]
lua_ir = "..."
letmut 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())?;

About

lua syntax parser & interpreter in Rust

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages