summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-06-11 21:39:59 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-06-11 22:05:03 -0400
commit460832c13c9d476d71e626a0c42de4eeff3feb63 (patch)
treeb3e5ea55f704d7e1672504eca8e99ffabe9c558a /lexer.c
parent0bc02d48d100aff63e40132786a89123ac43ae48 (diff)
Did some more stuff.
- Fix some bugs with strings. - Started to refactor the instruction functions. - Added support for using RS prefixes on the memory based increment, and decrement instructions. - Started work on SuBAsm's lexer. Have fun looking at this, BieHDC. :)
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lexer.c b/lexer.c
index 47109ca..df478b0 100644
--- a/lexer.c
+++ b/lexer.c
@@ -301,7 +301,9 @@ uint64_t lex(char *str, uint64_t address, uint8_t dbg) {
break;
case PTOK_DQUOTE:
i++;
- for (; isdelm(str[i+j], dbg) != 4; j++);
+ for (; isdelm(str[i+j], dbg) != 4 || isesc; j++) {
+ isesc = (str[i+j] == '\\' && str[i+(j-1)] != '\\');
+ }
memcpy(lexeme, str+i, j);
lexeme[j] = '\0';
i += j;
@@ -317,7 +319,7 @@ uint64_t lex(char *str, uint64_t address, uint8_t dbg) {
printf("lex(): str[0x%04X]: %s\n", strid, string[strid]);
}
if (lt->id == TOK_DIR && lt->type == DIR_INCLUDE) {
- incl[inc_count] = strid;
+ incl[inc_count+inc_file] = strid;
inc_file++;
}
lex_type = TOK_STRING;