summaryrefslogtreecommitdiff
path: root/masm/lex.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-09-10 18:23:46 -0400
committerFreya Murphy <freya@freyacat.org>2024-09-10 18:23:46 -0400
commit92a7e5853c6caeec09122c05ddbc19ae1498a0d8 (patch)
treed14a6a1c091df35c06ffb735ce3f6c72b1f37b42 /masm/lex.c
parentrelocation table hell (diff)
downloadmips-92a7e5853c6caeec09122c05ddbc19ae1498a0d8.tar.gz
mips-92a7e5853c6caeec09122c05ddbc19ae1498a0d8.tar.bz2
mips-92a7e5853c6caeec09122c05ddbc19ae1498a0d8.zip
joe
Diffstat (limited to 'masm/lex.c')
-rw-r--r--masm/lex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/masm/lex.c b/masm/lex.c
index 06c7114..788523b 100644
--- a/masm/lex.c
+++ b/masm/lex.c
@@ -19,7 +19,7 @@ static int lex_next(struct lexer *lexer)
int c = getc(lexer->file);
if (c == '\n') {
- lexer->x = 0;
+ lexer->x = 1;
lexer->y++;
} else {
lexer->x++;
@@ -296,13 +296,13 @@ int lexer_init(const char *path, struct lexer *lexer)
{
FILE *file = fopen(path, "r");
if (file == NULL) {
- ERROR_POS(pos, "cannot file '%s'", path);
+ ERROR("cannot read '%s'", path);
return M_ERROR;
}
lexer->file = file;
lexer->peek = EOF;
- lexer->x = 0;
- lexer->y = 0;
+ lexer->x = 1;
+ lexer->y = 1;
return M_SUCCESS;
}