GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ehwan/lua_rust: lua syntax parser & interpreter in Rust

BranchesTags
Open more actions menu

Latest commit

 

History

93 Commits
93 Commits

Folders and files

NameName
Last commit message
Last commit date
exec
exec
 
 
lua_ir
lua_ir
 
 
parser
parser
 
 
semantics
semantics
 
 
tokenizer
tokenizer
 
 
.gitignore
.gitignore
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE-APACHE
LICENSE-APACHE
 
 
LICENSE-MIT
LICENSE-MIT
 
 
README.md
README.md
 
 
complex.lua
complex.lua
 
 
note.txt
note.txt
 
 
rustfmt.toml
rustfmt.toml
 
 
sample.lua
sample.lua
 
 
test.lua
test.lua
 
 

Repository files navigation

lua_rust

crates.io docs.rs

lua syntax parser & runtime interpreter in Rust

  • LALR(1), GLR parser with RustyLR
  • syntax referenced from lua 5.4 reference manual
  • Greatly in progress
    • grammar fully implemented
    • std library barely implemented

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 = "..."
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() )?;

About

lua syntax parser & interpreter in Rust

Topics

compilerglr-parsinglalr1luarust

Resources

Readme
Activity

Stars

6 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.