diff options
author | Ian Moffett <ian@osmora.org> | 2024-11-01 23:46:08 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-11-01 23:46:08 -0400 |
commit | a515dfb3b8f8e999362db7a6b52b3104c03b750a (patch) | |
tree | d0180f0cbc39d9c3e367af30791ad774e4d419ff /include/lexer.h |
Import quark sources
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'include/lexer.h')
-rw-r--r-- | include/lexer.h | 22 |
1 files changed, 22 insertions, 0 deletions
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 */ |