harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ece6b51c633d10243e1a511daae2c8f57edd4e1e
parent 6546d097cc988c7c73f70e69c0a0ea45546ada61
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 11 Dec 2020 19:25:23 -0500

Revert "Fix lexing of \0"

This reverts commit 6546d097cc988c7c73f70e69c0a0ea45546ada61.

Diffstat:
Msrc/lex.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lex.c b/src/lex.c @@ -148,10 +148,10 @@ static uint32_t next(struct lexer *lexer, struct location *loc, bool buffer) { uint32_t c; - if (lexer->c[0] != UINT32_MAX) { + if (lexer->c[0] != 0) { c = lexer->c[0]; lexer->c[0] = lexer->c[1]; - lexer->c[1] = UINT32_MAX; + lexer->c[1] = 0; } else { c = utf8_fgetch(lexer->in); update_lineno(&lexer->loc, c); @@ -205,7 +205,6 @@ consume(struct lexer *lexer, ssize_t n) static void push(struct lexer *lexer, uint32_t c, bool buffer) { - assert(lexer->c[1] == UINT32_MAX); lexer->c[1] = lexer->c[0]; lexer->c[0] = c; if (buffer) {