1
0
Fork 0
forked from fun/fun

Fixed bug with wrong line numbers in error messages. Some examples refactoring and bug fixes. (0.39.15)

This commit is contained in:
Johannes Findeisen 2026-03-30 20:51:04 +02:00
commit 3d3c11496f
23 changed files with 265 additions and 114 deletions

View file

@ -18,7 +18,7 @@
* FUN_LIB_DIR="$(pwd)/lib" ./build/fun examples/sha1_demo.fun
*/
#include <crypt/sha1.fun> as sha1
include <crypt/sha1.fun>
print("=== SHA-1 demo ===")
@ -27,15 +27,15 @@ hex_abc = "616263" // "abc" in hex
empty = ""
// Hash ASCII string directly
d1 = sha1.SHA1().sha1_str(s)
d1 = SHA1().sha1_str(s)
print("SHA-1('abc') = " + d1)
// Hash pre-encoded hex bytes
d2 = sha1.SHA1().sha1_hex(hex_abc)
d2 = SHA1().sha1_hex(hex_abc)
print("SHA-1(616263 hex) = " + d2)
// Empty string
d3 = sha1.SHA1().sha1_str(empty)
d3 = SHA1().sha1_str(empty)
print("SHA-1('') = " + d3)
print("=== done ===")

View file

@ -75,7 +75,7 @@ main()
/* Expected when run with --repl-on-error (your version and line/ip may vary):
Runtime error: index out of range
(at ./examples/debug_reporting.fun:XX in crash, op INDEX_GET @ip YY)
(at ./examples/debug_reporting.fun:68 in crash, op INDEX_GET @ip 9)
Entering REPL due to runtime error (code 1)
Fun VERSION REPL
Type :help for commands. Submit an empty line to run.