aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-02-19 19:20:03 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-02-19 19:20:03 +0100
commit3114fc9d1609f6a01582a4c4148cb9596b620975 (patch)
tree774f3e4e6a37a53102b073246912091f08365c9f
parent24ef322b57d29d26224e7f9e772b3691143b2da2 (diff)
downloadsylt-3114fc9d1609f6a01582a4c4148cb9596b620975.tar.gz
demo automatic linkage (NOT WORKING)
-rw-r--r--src/main.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index f7d1fbf..69af682 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -47,6 +47,25 @@ fn parse_args() -> Args {
args
}
+#[sylt_macro::extern_link]
+pub fn f(x: sylt::Value, _typecheck: bool) -> Result<sylt::Value, sylt::error::ErrorKind> {
+ Ok(x)
+}
+
+#[sylt_macro::extern_link(g)]
+pub fn f2(x: sylt::Value, _typecheck: bool) -> Result<sylt::Value, sylt::error::ErrorKind> {
+ Ok(x)
+}
+
+mod m1 {
+ mod m2 {
+ #[sylt_macro::extern_link(h)]
+ pub fn f2(x: sylt::Value, _typecheck: bool) -> Result<sylt::Value, sylt::error::ErrorKind> {
+ Ok(x)
+ }
+ }
+}
+
sylt_macro::extern_function!(
extern_test
[sylt::Value::Float(x), sylt::Value::Float(y)] -> sylt::Type::Float => {