Skip to main content

roblox_rs_core/
lib.rs

1//! Core library for the roblox-rs compiler.
2//!
3//! This crate is responsible for translating Rust code to Luau for the Roblox platform.
4
5// Re-export core modules
6pub mod compiler;
7pub mod error;
8pub mod macros;
9
10// Feature-gated modules
11#[cfg(feature = "ast-parser")]
12pub mod ast;
13
14#[cfg(feature = "llvm-ir")]
15pub mod ir;
16
17#[cfg(feature = "roblox-api")]
18pub mod roblox;
19
20pub mod luau;
21pub mod utils;
22
23// Re-exports for convenience
24pub use compiler::{compile, CompileOptions};
25pub use error::{Error, Result};
26
27// Re-export macros
28pub use crate::macros::*;
29
30/// Current version of the crate
31pub const VERSION: &str = env!("CARGO_PKG_VERSION");
32
33#[cfg(test)]
34mod tests {
35    use super::*;
36
37    #[test]
38    fn it_works() {
39        let result = compile("fn main() { println!(\"Hello, world!\"); }", Default::default());
40        assert!(result.is_ok());
41    }
42}