aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2025-01-17 23:32:18 +0000
committerMichael Williamson <mike@zwobble.org>2025-01-17 23:32:18 +0000
commit436f43fa2667c77ef8a7d05bb5b8001c17c7822b (patch)
tree364fece3c5f4833713b1fd7d6e9f1a99dc8dd0a0 /examples
parent7c5489a16401738969f87bd1a5d89d0e1e736f99 (diff)
Add support for native functions
Diffstat (limited to 'examples')
-rw-r--r--examples/40-native-code/shed-examples.json59
-rw-r--r--examples/40-native-code/shed.json511
-rw-r--r--examples/40-native-code/src/False.shed5
3 files changed, 25 insertions, 0 deletions
diff --git a/examples/40-native-code/shed-examples.json5 b/examples/40-native-code/shed-examples.json5
new file mode 100644
index 00000000..1b45c0b5
--- /dev/null
+++ b/examples/40-native-code/shed-examples.json5
@@ -0,0 +1,9 @@
+{
+ examples: [
+ {
+ project: ".",
+ bin: "false",
+ expectedExitCode: 42,
+ },
+ ],
+}
diff --git a/examples/40-native-code/shed.json5 b/examples/40-native-code/shed.json5
new file mode 100644
index 00000000..b07dcaed
--- /dev/null
+++ b/examples/40-native-code/shed.json5
@@ -0,0 +1,11 @@
+{
+ bins: [
+ {
+ name: "false",
+ mainNamespace: "False",
+ },
+ ],
+ dependencies: [
+ {path: "../../projects/std"},
+ ],
+}
diff --git a/examples/40-native-code/src/False.shed b/examples/40-native-code/src/False.shed
new file mode 100644
index 00000000..75dc7a89
--- /dev/null
+++ b/examples/40-native-code/src/False.shed
@@ -0,0 +1,5 @@
+import Std/Process;
+
+pub fun main() ! Io -> Unit {
+ Process.exit!(42);
+}