From a515dfb3b8f8e999362db7a6b52b3104c03b750a Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 1 Nov 2024 23:46:08 -0400 Subject: Import quark sources Signed-off-by: Ian Moffett --- include/lexer.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/lexer.h (limited to 'include/lexer.h') diff --git a/include/lexer.h b/include/lexer.h new file mode 100644 index 0000000..99431ec --- /dev/null +++ b/include/lexer.h @@ -0,0 +1,22 @@ +/* + * Quark lexer (lexical analyzer). + * Turns source code into tokens. + * Copyright (c) 2023-2024, Quinn Stephens and the OSMORA team. + * Provided under the BSD 3-Clause license. + */ + +#ifndef _LEXER_H +#define _LEXER_H + +#include "lexer/token.h" + +struct lexer { + char *pos; + char *line_start; + int line; +}; + +void lexer_next(struct lexer *ctx, struct token *tok); +void lexer_init(struct lexer *ctx, char *source); + +#endif /* !_LEXER_H */ -- cgit v1.2.3