1
0
Fork 0
forked from fun/fun

Added basic local includes relative to $PWD and includes for files located at /usr/lib/fun.

This commit is contained in:
Johannes Findeisen 2025-09-27 17:39:03 +02:00
commit 5b7b063086
8 changed files with 356 additions and 6 deletions

View file

@ -0,0 +1,29 @@
#!/usr/bin/env fun
/*
* This file is part of the Fun programming language.
* https://hanez.org/project/fun/
*
* Copyright 2025 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the ISC license.
* https://opensource.org/license/isc-license-txt
*/
// To test this you need to go to ./examples/ and test includes running ../build/fun include_local.fun
// Local includes are always relative from the $PWD.
// Demonstrates local include:
// This resolves relative to the current working directory where 'fun' is executed.
#include "include_local_util.fun"
print("== include local demo ==")
greet("Fun")
number a = 2
number b = 3
print("sum(" + to_string(a) + ", " + to_string(b) + ") = " + to_string(sum(a, b)))
// Tip:
// To include from the system library directory (/usr/lib/fun), use angle brackets:
// #include <some_lib.fun>