From 3114fc9d1609f6a01582a4c4148cb9596b620975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Fri, 19 Feb 2021 19:20:03 +0100 Subject: demo automatic linkage (NOT WORKING) --- src/main.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') 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 { + Ok(x) +} + +#[sylt_macro::extern_link(g)] +pub fn f2(x: sylt::Value, _typecheck: bool) -> Result { + Ok(x) +} + +mod m1 { + mod m2 { + #[sylt_macro::extern_link(h)] + pub fn f2(x: sylt::Value, _typecheck: bool) -> Result { + Ok(x) + } + } +} + sylt_macro::extern_function!( extern_test [sylt::Value::Float(x), sylt::Value::Float(y)] -> sylt::Type::Float => { -- cgit v1.2.1