aboutsummaryrefslogtreecommitdiffstats
path: root/src/linked.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-02-20 20:30:58 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-02-20 20:30:58 +0100
commit6e97e9667967f90c66ff71f2c5468d5700887f24 (patch)
treeab8cb0ad26597891f421a8c6f8883479af8ad37f /src/linked.rs
parent2245aa052c4b4e3db841a68afc986838f4330f4e (diff)
downloadsylt-6e97e9667967f90c66ff71f2c5468d5700887f24.tar.gz
store linked functions in proc macro runtime and return them
Diffstat (limited to 'src/linked.rs')
-rw-r--r--src/linked.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/linked.rs b/src/linked.rs
new file mode 100644
index 0000000..6d6621c
--- /dev/null
+++ b/src/linked.rs
@@ -0,0 +1,18 @@
+#[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)
+ }
+ }
+}