lang: Remove symbols for now
Unfortunately until we can figure out how to build these at compile time we have to get rid of them. Sad.
This commit is contained in:
parent
fdbbb1531e
commit
f3d4142fd0
4 changed files with 0 additions and 34 deletions
|
@ -6,8 +6,6 @@
|
|||
|
||||
int lang_main(void) {
|
||||
printf("Hello world!\n");
|
||||
printf("symb %i\n", find_symbol("a"));
|
||||
printf("symb %i\n", find_symbol("b"));
|
||||
struct object *numA = number_create(5);
|
||||
struct object *numB = number_create(3);
|
||||
struct object *args[] = {numB};
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#ifndef OBJECT_H
|
||||
#define OBJECT_H
|
||||
|
||||
#include "symbol.h"
|
||||
#include <stdatomic.h>
|
||||
|
||||
// Forward declare the class as we need it in object
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2023 John Watts and the LuminaSensum contributors
|
||||
|
||||
#include "symbol.h"
|
||||
#include <stdint.h>
|
||||
|
||||
// FNV-1a Algorithm from http://www.isthe.com/chongo/tech/comp/fnv/
|
||||
// Thanks for releasing it to the public domain :)
|
||||
uint32_t fnv32a_text(unsigned char *text) {
|
||||
uint32_t hash = (uint32_t)0x811c9dc5;
|
||||
while (*text) {
|
||||
hash ^= (uint32_t)*text++;
|
||||
hash *= (uint32_t)0x01000193;
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
symbol find_symbol(char *name) { return fnv32a_text((unsigned char *)name); }
|
|
@ -1,13 +0,0 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2023 John Watts and the LuminaSensum contributors
|
||||
|
||||
#ifndef SYMBOL_H
|
||||
#define SYMBOL_H
|
||||
|
||||
// Symbols are integers with unique values
|
||||
typedef int symbol;
|
||||
|
||||
// Find a unique value associated with the symbol's name
|
||||
symbol find_symbol(char *name);
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue