This commit is contained in:
attilavs2 2025-03-02 22:47:04 +01:00
parent 4399f5bae9
commit a58c4064f8
3 changed files with 44 additions and 41 deletions

26
spec.md
View file

@ -20,38 +20,38 @@
C : int x = a[0];
```
For vectors and strings, it's a shallow copy (data is the same) unless a `*`
is specified before [arg]
is specified before `[arg]`
- Compiled to bytecode
In this document :
- <...> :
- `<...>` :
Mandatory argument
- [...] :
- `[...]` :
Optional argument
- | :
- `|` :
Or
## Core types
- null :
- `null`:
Represents a null value - always evaluates to false
- int :
- `int`:
32 bit signed integer, evaluates to false if zero and true otherwise
- fix :
- `fix`:
16:16 bit fixed point signed integer, same evaluation rules as ints
- float :
- `float`:
32bit IEEE floating point value, same evaluation as ints (within
`FL_ESPILOǸ̀`)
- str:
- `str`:
ASCII character string - always evaluates to false
- fn:
- `fn`:
Function, function "variables" are inherently of type fn - handle with care !
- vec :
Vectors of any type,
- `vec`:
Vectors of any type
## Core functions
- `(var[:type] <name> [size])` :
- `(var[:type] <name> [size])`:
Declares a global variable of optional type type and name name
if type is of format `:vec:<type>`, the variable will be a vector
of type type, and optional size size (otherwise size 0)

View file

@ -2,6 +2,8 @@
#pragma once
#define FL_EPSILON (1e-6f)
enum OpTypes {
OP_add = 0,
OP_sub = 1,

View file

@ -4,6 +4,7 @@
#include <string.h>
#include "types.h"
#include "byte_defs.h"
int main(){