harec

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

commit c26d54f7fe60f5615c9e1f71534b619ee14ae2c7
parent 8eebe3daf7a71857999fc781440f060309d7aa3d
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 22 Nov 2020 08:53:23 -0500

lex: return lexical_token from lex()

Diffstat:
Minclude/lex.h | 2+-
Msrc/lex.c | 8++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/lex.h b/include/lex.h @@ -142,7 +142,7 @@ struct lexer { void lex_init(struct lexer *lexer, FILE *f); void lex_finish(struct lexer *lexer); -uint32_t lex(struct lexer *lexer, struct token *out); +enum lexical_token lex(struct lexer *lexer, struct token *out); void token_finish(struct token *tok); const char *token_str(const struct token *tok); diff --git a/src/lex.c b/src/lex.c @@ -431,7 +431,7 @@ lex_rune(struct lexer *lexer) assert(0); } -static uint32_t +static enum lexical_token lex_string(struct lexer *lexer, struct token *out) { uint32_t c = next(lexer, false); @@ -480,7 +480,7 @@ lex_string(struct lexer *lexer, struct token *out) assert(0); } -static uint32_t +static enum lexical_token lex3(struct lexer *lexer, struct token *out, uint32_t c) { assert(c != UTF8_INVALID); @@ -556,7 +556,7 @@ lex3(struct lexer *lexer, struct token *out, uint32_t c) return out->token; } -static uint32_t +static enum lexical_token lex2(struct lexer *lexer, struct token *out, uint32_t c) { assert(c != UTF8_INVALID); @@ -708,7 +708,7 @@ lex2(struct lexer *lexer, struct token *out, uint32_t c) return out->token; } -uint32_t +enum lexical_token lex(struct lexer *lexer, struct token *out) { uint32_t c = wgetc(lexer);