1
0
Fork 0
forked from fun/fun

Added some missing license headers and some cosmetic changes.

This commit is contained in:
Johannes Findeisen 2025-09-27 10:12:44 +02:00
commit ff155b6a31
9 changed files with 56 additions and 4 deletions

View file

@ -1,5 +1,14 @@
#!/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
*/
// Environment variables via env(name):
// - Returns the value as a string.
// - If the variable is not set, returns an empty string.

View file

@ -7,10 +7,8 @@
* https://opensource.org/license/isc-license-txt
*/
#include "bytecode.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Bytecode *bytecode_new(void) {

View file

@ -7,7 +7,6 @@
* https://opensource.org/license/isc-license-txt
*/
#ifndef FUN_BYTECODE_H
#define FUN_BYTECODE_H

View file

@ -35,7 +35,6 @@
* @date 2025-10-16
*/
#ifndef FUN_VALUE_H
#define FUN_VALUE_H

View file

@ -1,3 +1,12 @@
/**
* 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
*/
case OP_LINE: {
/* operand holds the source line number */
vm->current_line = inst.operand;

View file

@ -1,3 +1,14 @@
/**
* 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
*/
// Get environment variables of the operation system.
case OP_ENV: {
Value key = pop_value(vm);
if (key.type != VAL_STRING) {

View file

@ -1,3 +1,12 @@
/**
* 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
*/
case OP_SCLAMP: {
/* Clamp/wrap to signed N-bit range: [-2^(N-1), 2^(N-1)-1] */
Value v = pop_value(vm);

View file

@ -1,3 +1,12 @@
/**
* 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
*/
case OP_TYPEOF: {
Value v = pop_value(vm);
const char *tname = "Unknown";

View file

@ -1,3 +1,12 @@
/**
* 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
*/
case OP_UCLAMP: {
/* Clamp/wrap the integer on top of the stack to 'bits' width (unsigned) */
Value v = pop_value(vm);