Add scaffolding for new regex builtin

This commit is contained in:
Filip Tibell 2024-04-20 22:09:48 +02:00
parent 70f0c55d35
commit e11302766b
No known key found for this signature in database
2 changed files with 12 additions and 0 deletions

View file

@ -7,6 +7,7 @@ mod fs;
mod luau; mod luau;
mod net; mod net;
mod process; mod process;
mod regex;
mod serde; mod serde;
mod stdio; mod stdio;
mod task; mod task;
@ -22,6 +23,7 @@ pub enum LuneBuiltin {
Net, Net,
Task, Task,
Process, Process,
Regex,
Serde, Serde,
Stdio, Stdio,
#[cfg(feature = "roblox")] #[cfg(feature = "roblox")]
@ -37,6 +39,7 @@ impl LuneBuiltin {
Self::Net => "net", Self::Net => "net",
Self::Task => "task", Self::Task => "task",
Self::Process => "process", Self::Process => "process",
Self::Regex => "regex",
Self::Serde => "serde", Self::Serde => "serde",
Self::Stdio => "stdio", Self::Stdio => "stdio",
#[cfg(feature = "roblox")] #[cfg(feature = "roblox")]
@ -52,6 +55,7 @@ impl LuneBuiltin {
Self::Net => net::create(lua), Self::Net => net::create(lua),
Self::Task => task::create(lua), Self::Task => task::create(lua),
Self::Process => process::create(lua), Self::Process => process::create(lua),
Self::Regex => regex::create(lua),
Self::Serde => serde::create(lua), Self::Serde => serde::create(lua),
Self::Stdio => stdio::create(lua), Self::Stdio => stdio::create(lua),
#[cfg(feature = "roblox")] #[cfg(feature = "roblox")]
@ -77,6 +81,7 @@ impl FromStr for LuneBuiltin {
"net" => Ok(Self::Net), "net" => Ok(Self::Net),
"task" => Ok(Self::Task), "task" => Ok(Self::Task),
"process" => Ok(Self::Process), "process" => Ok(Self::Process),
"regex" => Ok(Self::Regex),
"serde" => Ok(Self::Serde), "serde" => Ok(Self::Serde),
"stdio" => Ok(Self::Stdio), "stdio" => Ok(Self::Stdio),
#[cfg(feature = "roblox")] #[cfg(feature = "roblox")]

View file

@ -0,0 +1,7 @@
use mlua::prelude::*;
use crate::lune::util::TableBuilder;
pub fn create(lua: &Lua) -> LuaResult<LuaTable> {
TableBuilder::new(lua)?.build_readonly()
}