Skip to main content

Crate s2s2lua

Crate s2s2lua 

Source
Expand description

Transpile Stranded II .s2s scripts into Lua for OpenStranded.

Uses core_api.* namespace for all commands, matching the s2s API 1:1.

§Example

use s2s2lua::{S2sParser, LuaGenerator, GenOptions};

let script = S2sParser::parse(r#"on:start { msg "Hello!"; }"#).unwrap();
let lua = LuaGenerator::generate(&script, GenOptions::default()).unwrap();
println!("{}", lua);

Re-exports§

pub use ast::*;
pub use error::*;
pub use generator::*;
pub use parser::*;
pub use token::*;

Modules§

ast
AST node types for parsed .s2s scripts.
error
Error types for the s2s transpiler.
generator
Lua code generator.
parser
Recursive descent parser for .s2s scripts.
token
Logos-based tokenizer for .s2s scripts.