summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/lexer.c b/lexer.c
index 873fe6d..bb3701a 100644
--- a/lexer.c
+++ b/lexer.c
@@ -844,8 +844,7 @@ uint64_t lex(char *str, uint64_t address, uint16_t bline, uint8_t dbg) {
}
}
if (!isop) {
- uint8_t spaces = 0;
- if (l->tok && l->tok->type == TOK_ORTHO && l->tok->byte == SET) {
+ if (l->tok && l->tok->id == TOK_ORTHO && l->tok->byte == SET) {
for (k = 0; k < 8; k++) {
int upper = toupper(lexeme[0]);
if (upper == set_cc[k][0]) {
@@ -856,40 +855,42 @@ uint64_t lex(char *str, uint64_t address, uint16_t bline, uint8_t dbg) {
}
}
}
- }
- for (; isdelm(str[i+spaces], dbg) == 16; spaces++);
- uint8_t ret = get_ptok(str[i+spaces], dbg);
- if (ret == PTOK_COLON || ret == PTOK_EQU) {
- islocal = (lex_type == TOK_LOCAL);
- }
- lex_type = TOK_SYM;
- l->count++;
- t = make_token(lex_type, islocal, space, tab, 0, "", NULL);
- memcpy(sym, lexeme, j+1);
- if (dbg) {
- printf("lex(): spaces: %u\n", spaces);
- }
- if (is_struct) {
- create_struct(cur_sym, l, t, lt, sym, dbg);
- islocal = 0;
- } else if ((str[i+spaces] != ':' && str[i+spaces] != '=')) {
- uint8_t sym_struct = 0;
- symbol *s;
- /*tmp_sym = (s && s->isstruct) ? NULL : tmp_sym;*/
- if (tmp_sym) {
- t->sym = find_member(lexeme, tmp_sym, dbg);
- tmp_sym = NULL;
- } else {
- t->sym = get_sym(lexeme, address, t, islocal, dbg);
+ } else {
+ uint8_t spaces = 0;
+ for (; isdelm(str[i+spaces], dbg) == 16; spaces++);
+ uint8_t ret = get_ptok(str[i+spaces], dbg);
+ if (ret == PTOK_COLON || ret == PTOK_EQU) {
+ islocal = (lex_type == TOK_LOCAL);
}
- isfixup += (t && t->sym == NULL);
- islocal = 0;
+ lex_type = TOK_SYM;
+ l->count++;
+ t = make_token(lex_type, islocal, space, tab, 0, "", NULL);
+ memcpy(sym, lexeme, j+1);
if (dbg) {
- printf("lex(): isfixup: %u\n", isfixup);
+ printf("lex(): spaces: %u\n", spaces);
+ }
+ if (is_struct) {
+ create_struct(cur_sym, l, t, lt, sym, dbg);
+ islocal = 0;
+ } else if ((str[i+spaces] != ':' && str[i+spaces] != '=')) {
+ uint8_t sym_struct = 0;
+ symbol *s;
+ /*tmp_sym = (s && s->isstruct) ? NULL : tmp_sym;*/
+ if (tmp_sym) {
+ t->sym = find_member(lexeme, tmp_sym, dbg);
+ tmp_sym = NULL;
+ } else {
+ t->sym = get_sym(lexeme, address, t, islocal, dbg);
+ }
+ isfixup += (t && t->sym == NULL);
+ islocal = 0;
+ if (dbg) {
+ printf("lex(): isfixup: %u\n", isfixup);
+ }
+ }
+ if (!is_struct && t && t->sym && t->sym->isstruct) {
+ tmp_sym = t->sym;
}
- }
- if (!is_struct && t && t->sym && t->sym->isstruct) {
- tmp_sym = t->sym;
}
}
break;