mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 04:50:36 +00:00
Add scaffolding for new regex builtin
This commit is contained in:
parent
70f0c55d35
commit
e11302766b
2 changed files with 12 additions and 0 deletions
|
@ -7,6 +7,7 @@ mod fs;
|
|||
mod luau;
|
||||
mod net;
|
||||
mod process;
|
||||
mod regex;
|
||||
mod serde;
|
||||
mod stdio;
|
||||
mod task;
|
||||
|
@ -22,6 +23,7 @@ pub enum LuneBuiltin {
|
|||
Net,
|
||||
Task,
|
||||
Process,
|
||||
Regex,
|
||||
Serde,
|
||||
Stdio,
|
||||
#[cfg(feature = "roblox")]
|
||||
|
@ -37,6 +39,7 @@ impl LuneBuiltin {
|
|||
Self::Net => "net",
|
||||
Self::Task => "task",
|
||||
Self::Process => "process",
|
||||
Self::Regex => "regex",
|
||||
Self::Serde => "serde",
|
||||
Self::Stdio => "stdio",
|
||||
#[cfg(feature = "roblox")]
|
||||
|
@ -52,6 +55,7 @@ impl LuneBuiltin {
|
|||
Self::Net => net::create(lua),
|
||||
Self::Task => task::create(lua),
|
||||
Self::Process => process::create(lua),
|
||||
Self::Regex => regex::create(lua),
|
||||
Self::Serde => serde::create(lua),
|
||||
Self::Stdio => stdio::create(lua),
|
||||
#[cfg(feature = "roblox")]
|
||||
|
@ -77,6 +81,7 @@ impl FromStr for LuneBuiltin {
|
|||
"net" => Ok(Self::Net),
|
||||
"task" => Ok(Self::Task),
|
||||
"process" => Ok(Self::Process),
|
||||
"regex" => Ok(Self::Regex),
|
||||
"serde" => Ok(Self::Serde),
|
||||
"stdio" => Ok(Self::Stdio),
|
||||
#[cfg(feature = "roblox")]
|
||||
|
|
7
src/lune/builtins/regex/mod.rs
Normal file
7
src/lune/builtins/regex/mod.rs
Normal 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()
|
||||
}
|
Loading…
Reference in a new issue