diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-02-13 13:59:48 -0500 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-02-13 13:59:48 -0500 |
commit | 8d7f27d9a0b61d3694a62f3e54be885d8073f02b (patch) | |
tree | b505454c79dba2e691ee19f716ccfd0d0aba1430 /lexer.c | |
parent | ac778a4d39ba6c80651ce20ce780dfe859c3dcff (diff) |
- Reverted back one commit before the previous commit.
This is because the previous commit actually created
a bug, rather than fixing one.
- Added JMP, and JSR to the ortho extension, and
implemented them both in the assembler, and
emulator.
Diffstat (limited to 'lexer.c')
-rw-r--r-- | lexer.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -773,6 +773,7 @@ int get_expr_type(char **p, uint64_t address, void *val, int *found_reg, char st expr *parse_expr(char **line, uint64_t address, int *found_reg, int is_left, char stop, uint8_t dbg) { char *str = *line; + char *start = *line; int dummy = 0; found_reg = (found_reg == NULL) ? &dummy : found_reg; @@ -833,7 +834,6 @@ expr *parse_expr(char **line, uint64_t address, int *found_reg, int is_left, cha left = new; } } - *line = str; return left; } @@ -1035,7 +1035,7 @@ uint64_t lex(char *str, uint64_t address, uint16_t bline, uint8_t dbg) { lex_type = TOK_EXPR; memset(lexeme, 0, strlen(lexeme)+1); char *tmp = &str[i]; - expr *e = parse_expr(&tmp, address, NULL, 1, delm, dbg); + expr *e = parse_expr(&tmp, address, NULL, 0, delm, dbg); t = make_token(lex_type, 0, space, tab, 0, "", NULL, e); j = tmp - &str[i]; memcpy(lexeme, &str[i], j); @@ -1070,7 +1070,7 @@ uint64_t lex(char *str, uint64_t address, uint16_t bline, uint8_t dbg) { memset(lexeme, 0, strlen(lexeme)+1); do { char *tmp = &str[i]; - expr *e = parse_expr(&tmp, address, NULL, 1, delm, dbg); + expr *e = parse_expr(&tmp, address, NULL, 0, delm, dbg); t = make_token(lex_type, 0, space, tab, 0, "", NULL, e); j = tmp - &str[i]; memcpy(lexeme, &str[i], j); @@ -1296,7 +1296,7 @@ uint64_t lex(char *str, uint64_t address, uint16_t bline, uint8_t dbg) { lex_type = TOK_EXPR; memset(lexeme, 0, strlen(lexeme)+1); char *tmp = &str[i]; - expr *e = parse_expr(&tmp, address, NULL, 1, delm, dbg); + expr *e = parse_expr(&tmp, address, NULL, 0, delm, dbg); j = tmp - &str[i]; memcpy(lexeme, &str[i], j); /*i += j;*/ |