// the function to auto-detect the scope
// if a label starts with @ the current scope is used, otherwise 0 is used
// if the symbol already exists -1 is returned
-int ulas_symbolset(int scope, struct ulas_sym symbol);
+int ulas_symbolset(const char *name, int scope, struct ulas_tok tok,
+ int constant);
// tokenisze according to pre-defined rules
// returns the amount of bytes of line that were
return NULL;
}
-int ulas_symbolset(int scope, struct ulas_sym symbol) {
+int ulas_symbolset(const char *name, int scope, struct ulas_tok tok,
+ int constant) {
int rc = 0;
int resolve_rc = 0;
- const char *name = symbol.name;
struct ulas_sym *exisitng = ulas_symbolresolve(name, &resolve_rc);
// define new
if (!exisitng) {
void ulas_symbufclear(struct ulas_symbuf *sb) {
for (long i = 0; i < sb->len; i++) {
struct ulas_sym *s = &sb->buf[i];
+ free(s->name);
ulas_tokfree(&s->tok);
}
sb->len = 0;