Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkleiny committed Jul 13, 2024
1 parent 3593ef6 commit fd33540
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ serializer-yaml = ["common/yaml"]
lang-basic = ["scripting/basic"]
lang-wren = ["scripting/wren"]
lang-lua = ["scripting/lua"]
lang-lisp = ["scripting/lisp"]

[workspace.dependencies]
# shared dependencies
Expand Down
3 changes: 2 additions & 1 deletion crates/scripting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ common = { package = "surreal-common", path = "../common" }
[features]
basic = []
wren = []
lua = []
lua = []
lisp = []
4 changes: 2 additions & 2 deletions crates/scripting/src/lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
use common::{Singleton, ToVirtualPath};

use super::*;

#[cfg(feature = "basic")]
pub mod basic;
#[cfg(feature = "lisp")]
pub mod lisp;
#[cfg(feature = "lua")]
pub mod lua;
#[cfg(feature = "wren")]
Expand Down
14 changes: 1 addition & 13 deletions crates/scripting/src/lang/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,11 @@
use super::*;

/// The BASIC script language
/// The BASIC scripting language
pub struct BASIC;

impl ScriptLanguage for BASIC {
fn load(_path: impl ToVirtualPath) -> Result<Script, ScriptError> {
todo!()
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_load_basic_files_from_file_system() {
let script = Script::from_path::<BASIC>("tests/test.basic").unwrap();

assert_eq!(script.module.name, "test");
}
}
12 changes: 12 additions & 0 deletions crates/scripting/src/lang/lisp.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! LISP language support for Surreal
use super::*;

/// The LISP scripting language
pub struct Lisp;

impl ScriptLanguage for Lisp {
fn load(_path: impl ToVirtualPath) -> Result<Script, ScriptError> {
todo!()
}
}
2 changes: 1 addition & 1 deletion crates/scripting/src/lang/lua.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Lua support for Surreal
//! Lua language support for Surreal
use super::*;

Expand Down
2 changes: 1 addition & 1 deletion crates/scripting/src/lang/wren.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Wren support for surreal
//! Wren language support for surreal
use super::*;

Expand Down

0 comments on commit fd33540

Please sign in to comment.