Rhai function names with $ and . no longer fail.
This commit is contained in:
parent
8abb3c5203
commit
a6fa94d946
@ -1,28 +0,0 @@
|
||||
use rhai::plugin::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Point {
|
||||
x: f32,
|
||||
y: f32,
|
||||
}
|
||||
|
||||
#[export_module]
|
||||
pub mod test_module {
|
||||
pub use super::Point;
|
||||
#[rhai_fn(name = "big$caching")]
|
||||
pub fn test_fn(input: Point) -> bool {
|
||||
input.x > input.y
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let n = Point {
|
||||
x: 0.0,
|
||||
y: 10.0,
|
||||
};
|
||||
if test_module::test_fn(n) {
|
||||
println!("yes");
|
||||
} else {
|
||||
println!("no");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
error: Rhai function names may not contain dollar sign
|
||||
--> $DIR/rhai_fn_rename_dollar_sign.rs:12:22
|
||||
|
|
||||
12 | #[rhai_fn(name = "big$caching")]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: use of undeclared crate or module `test_module`
|
||||
--> $DIR/rhai_fn_rename_dollar_sign.rs:23:8
|
||||
|
|
||||
23 | if test_module::test_fn(n) {
|
||||
| ^^^^^^^^^^^ use of undeclared crate or module `test_module`
|
@ -1,28 +0,0 @@
|
||||
use rhai::plugin::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Point {
|
||||
x: f32,
|
||||
y: f32,
|
||||
}
|
||||
|
||||
#[export_module]
|
||||
pub mod test_module {
|
||||
pub use super::Point;
|
||||
#[rhai_fn(name = "foo.bar")]
|
||||
pub fn test_fn(input: Point) -> bool {
|
||||
input.x > input.y
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let n = Point {
|
||||
x: 0.0,
|
||||
y: 10.0,
|
||||
};
|
||||
if test_module::test_fn(n) {
|
||||
println!("yes");
|
||||
} else {
|
||||
println!("no");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
error: Rhai function names may not contain dot
|
||||
--> $DIR/rhai_fn_rename_dot.rs:12:22
|
||||
|
|
||||
12 | #[rhai_fn(name = "foo.bar")]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: use of undeclared crate or module `test_module`
|
||||
--> $DIR/rhai_fn_rename_dot.rs:23:8
|
||||
|
|
||||
23 | if test_module::test_fn(n) {
|
||||
| ^^^^^^^^^^^ use of undeclared crate or module `test_module`
|
Loading…
Reference in New Issue
Block a user