Add very important stuff that compiles!!!

This commit is contained in:
2026-05-05 21:45:58 +02:00
parent 861fffb244
commit 98826534a1
3 changed files with 99 additions and 0 deletions

View File

@@ -3,6 +3,9 @@
typedef enum noomC_InstrType : unsigned char {
NOOMC_INSTR_NOP = 0,
NOOMC_INSTR_LOADC,
NOOMC_INSTR_LOAD_NIL,
NOOMC_INSTR_LOAD_TRUE,
NOOMC_INSTR_LOAD_FALSE,
NOOMC_INSTR_COPY,
NOOMC_INSTR_JMP,
@@ -37,7 +40,11 @@ typedef enum noomC_InstrType : unsigned char {
NOOMC_INSTR_CONCAT,
NOOMC_INSTR_LEN,
NOOMC_INSTR_GET,
NOOMC_INSTR_GETI,
NOOMC_INSTR_SET,
NOOMC_INSTR_SETI,
NOOMC_INSTR_LOAD_NFT,
NOOMC_INSTR_NOP2 = 0xff,
} noomC_InstrType;
@@ -54,3 +61,89 @@ typedef struct noomC_Instr {
short s;
};
} noomC_Instr;
typedef enum noomC_ImmType {
NOOMC_IMM_INT,
NOOMC_IMM_FLOAT,
NOOMC_IMM_STRING,
NOOMC_IMM_TABLE,
} noomC_ImmType;
typedef struct noomC_Imm {
noomC_ImmType type;
union {
// we love math
noom_int_t Z;
noom_float_t Q;
// NOT A MATH THING
noom_string_t string;
noom_table_t table;
// ░░░░░░░░░ ░ ▒░░▒ ▒░ ░░ ░
// ░░░░░░░░░ █░█░▓▓ ░█▒████▒░ █░░████▓
// ░░░░░░░░░ ▓████████░█░▒████▓░████ ░█░
// ░░░░░░░░░ ░░░ ░█▓░█▒█░█░▒▒█▓████▒ ░█▒█ ░█░░
// ░░░░░░░░░ ░░░░░ ░█▓▓███▒█ ▓▓▒▒▒▓▓▒ ▒█▒█▓██▓▓
// ░░░░░░░░░ ░░ ░▓▓███▓█▒░░█▒▓█▓██▓ ▒▓█▓▓▓█▒▒
// ░░░░░░░░░░ ░░ ▒▓█░█▒█░ ░▓▓██████░░██░░▒█
// ░░░░░░░░░░ ░░░░ ░░ ▓▓█▒█▓█▒░ ▒▒▒█▒░█░ ███░░█
// ░░░░░░░░░░ ░░ ▓▒▓███░█▒ ▒░░░▓▓█░░██░▓▒██
// ░░░░░░░░░░ ░░ ░ ░░ ░░ ░░ ░░ ▒░ ░░░ ░░
// ░░░░░░░░░░ ░ ░░░ ░ ░ ░ ░
// ░░░░░░░░░░ ░░░░ ░░ ░
// ░ ░░░░░░░░░ ░░░░ ░ ░ ░ ░░ ░░░ ░░░ ░ ░░
// ░░░░░░░░░ ░ █████ ▒████ ░▓███▓░ ░████░ ░████▓ ░████░ ░▓███▓ ░████░
//░░ ░░░░░░░░░ █▓▒██░░██▓██▒░░██▒██░░██▒▓██░▒██▒██ ██▓▓██ ░██▒██░ ██▒▓██
//░░ ░░░░░░░░░░ ██░▒█▓ ░██░██▒ ▒█▒░██ ░██ ██░ ▓█▒░██ ░██░██░ ▓█▒░██ ██░
// ░░░░░░░░░░░ ░▓███░▒█▓ ██░██░ ▒██▒██ ░██░██ ▒█▒░██ ░██░██░ ▒█▓▒█▓ ░██░
// ░░░░░░░░░░ ░ ░▒███░ ▓████░▓█▒ ░██░██░ ▒██▒█▓ ░██░██ ░▒█▒░██ ░██░██░ ░██▒█▓ ░██░░
// ░░░░░░░░░ ░░ ░ ░░██▓▓█▓░░██ ██░ ▒█▓▒█▓ ██░██░ ▒█▒░██ ░██░██░ ░██▒█▓ ░██░░
// ░░░░░░░░░░ ░░░░ ░ ░███▒██ ░██ ██▒ ▓█▒▒██ ░██░██░ ██░░██░░██ ██▒ ▓█░░██ ░██
// ░░░░░░░░░ ░░░ ░█████▒░█████▒▒▓█████ ░█████▒ ▒█████▓██████▓ ▒██▓██░ █████▒
// ░░░░░░░░░ ░░ ░████▒ ░░███▒░█▒▒███░ ░███▓ ▓███░▓█░███▓░ ▒███░ ░███▒
// ░░░░░░░░░░ ░█░ ░ ░ ▒▒ ░
// ░░░░░░░░░ ░ ░
// ░░░░░░░░░ ░░░░
// ░░░░░░░░░ ░░░░░ ░░ ░ ░ ░ ░
// ░░░░░░░░░ ░░ ░░▒░░ ░▓▒ ░█▓ ░ ░ ░
// ░░░░░░░░░ ░░ ▒█████░ ░██ ░██ ░ ░
// ░░░░░░░░░░░░░ ██▒▒███ ░░ ░ ░ ░░ ░░ ░██
// ░ ░░░░░░░░░░░░░░░ ██░ ░▓▓ ░████ ░████░░█▓ ▒███▓░░██
// ░░░░░░░░░░░░░░░░░░░░░▓███░░ ░██████░██▓██▓▒██░██▓██▒▒██░
// ░░░░░░░░░░░░░░░░░░░░ ░████░░█▓ ██░██ ▓▓░██ ░░▒██▓▒██░ ░
// ░░░░░░░░░░░░░░░░░░░ ░░░░███▒█▓ ██▒██ ░░██░█████▓▒██░ ░░ ░
// ░░░░░░░░░░░░░░░░░░ ░██▒ ░██▒██░░██░██ ░█▓░██░██░▓█▓░██░ ░ ██▓████████▓▒██▒
// ░░░░░░░░░░░░░░░░░ ░██████▓ █████▓ █████▓▒██░█████▓░██░ ░ ░░░███████████▓█▓
// ░░░░░░░░░░░░░░░░░░ ░▓███▒ ░███▒ ░▓██▓ ░█▓ ▒██▓█▓░██░ ░████████████▓█░
// ░░░░░░░░░░░░░░░░░ ░ ░ ░█████████▓██
// ░░░░░░░░░░░░░░ ░░ ▒███████▓█▓
// ░ ░░░░░░░░░░░░░░ ░░░░ ██▓██▓▓▓███ ░
// ░░░░░░░░░░░░░░░ ░░ ░ ░███████████
// ░░░░░░░░░░░░ ░░ ░ ████████████ ▒
// ░░░░░░░░░░░░ ░░▒▒░░ ░ ░██░▓█░ ░ ░░████ ▒██████ █
// ░░░░░░░░░░░ ▓█████░ ░██ ██░░█▓░ ▓████ ▓█████ ░█ ▒▒
// ░░░░░░░░░░░ ▒██░░██▒░░░░░ ░░░░░ ░░░░██ ░░░██░ █████ ▒█████ ▒█ ▒█░
// ░░░░░░░░░░░░░ ██▒ ░█▓░████░████░ ░█████ ██▒████ █████ ▓████▒ ████░
// ░░░░░░░░░░░░ ██░ ▒███▓██▓▓██ ██▒▒██ ██░▒██░ ████▒ █████ ▒████████
// ░░░░░░░░░░ ██░ ░ ▒██░ ██▒▒██░██ ░██ ██ ░██░ ░████ ░█████ ▓██▓▒░░
// ░░░░░░░░░░ ██▒ ░▒░▒██ ░██████▒██ ░██░██░░██ ▒███▒ █████▒
// ░ ░░░░░░░░░ ▓█▓░ ▓█▓▒██ ░██░ ░░░██ ░██ ██░░██░ ░███░░░█████
// ░░░░░░░░░ ██████ ▒█▓ ▓█████ ██████ ██░░███░ ░██▒ █████▒
// ░░░░░░░░░ ░▓███░░░█▓ ░░▒███░░░██▓█▓ ▓█░ ▒█▓░ ▓▓ ░█████
// ░░░░░░░░░ ░░░░ ░░ ░░ ░ ░ ▓▒ ▓████░
// ░░░░░░░░ ░░ ░░ ░ ▒▓ ████▒
// ░ ░░░░░ ░ ░ ▒░▓███▒
// ░░░░ ░ ░▓▓██
// ░░░
// ░░░
// ░░
};
} noomC_Imm;
typedef struct noomC_Function {
noomC_Imm *immediates;
noomC_Instr *instructions;
} noomC_Function;
typedef struct noomC_Module {
noomC_Function *functions;
} noomC_Module;

View File

@@ -1,3 +1,5 @@
#define NOOM_USE_NFT 0
typedef enum noom_LuaVersion {
// no 5.0, at least for now, cause it doesn't seem to be used much and is a bit *weird*
NOOM_VERSION_51,

View File

@@ -1,2 +1,6 @@
typedef unsigned long long int noom_uint_t;
typedef signed long long int noom_int_t;
typedef double noom_float_t;
typedef unsigned char noom_bool_t;
typedef void * noom_table_t; // atom figure this shit out
typedef char * noom_string_t;