sym changes
This commit is contained in:
parent
83f85858ca
commit
4b31e09cd7
@ -162,12 +162,6 @@ enum SLC_IO_OP {
|
||||
};
|
||||
typedef enum SLC_IO_OP SLC_IO_OP;
|
||||
|
||||
union symptr {
|
||||
uint32_t *varp;
|
||||
word *worp;
|
||||
};
|
||||
typedef union symptr symptr;
|
||||
|
||||
struct do_not_save_charptr {
|
||||
char *ptr;
|
||||
};
|
||||
@ -189,7 +183,7 @@ typedef struct do_not_save_charptr do_not_save_charptr;
|
||||
* @param ptr When adding a found word/variable to the symbol table, the key will point to this word* or uint32_t*
|
||||
* @returns The word/var definition stored for the key, or NULL when it is not stored yet or op is SET and there was an error.
|
||||
*/
|
||||
typedef symptr (*sym)(SLC_SYM_OP op, do_not_save_charptr key, symptr ptr);
|
||||
typedef void* (*sym)(SLC_SYM_OP op, do_not_save_charptr key, void *ptr);
|
||||
|
||||
/**
|
||||
* Function-abstraction for an integer "stack".
|
||||
|
6
main.c
6
main.c
@ -6,7 +6,7 @@
|
||||
#define SLC_DEBUG
|
||||
#include "engine/slc.h"
|
||||
|
||||
symptr nopsym(SLC_SYM_OP op, do_not_save_charptr key, symptr ptr) {
|
||||
void *nopsym(SLC_SYM_OP op, do_not_save_charptr key, void *ptr) {
|
||||
if(op == SLC_SYM_ERASE) {
|
||||
printf("SYM_ERASE\n");
|
||||
} else {
|
||||
@ -15,9 +15,7 @@ symptr nopsym(SLC_SYM_OP op, do_not_save_charptr key, symptr ptr) {
|
||||
printf(" %s", key.ptr);
|
||||
}
|
||||
|
||||
symptr ret;
|
||||
ret.worp = NULL;
|
||||
return ret;
|
||||
return NULL;
|
||||
// TODO: Create a "peasantly" symbol table where we have:
|
||||
// - 32 previndex
|
||||
// - 32 nextindex
|
||||
|
Loading…
x
Reference in New Issue
Block a user