diff options
author | Anton Kling <anton@kling.gg> | 2024-05-02 16:52:26 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-05-02 18:35:47 +0200 |
commit | ad8619ae362b4b626e99b90b1b7c4d7e59125f65 (patch) | |
tree | 2d46caa903ba9435fc51012b6ddf41292ad316f7 /userland/minibox/utilities/sh/lexer.h | |
parent | faebb71b8a84e33f4f2b3f8f70f845011483c5c5 (diff) |
sh: Use string view instead of C strings
Diffstat (limited to 'userland/minibox/utilities/sh/lexer.h')
-rw-r--r-- | userland/minibox/utilities/sh/lexer.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/userland/minibox/utilities/sh/lexer.h b/userland/minibox/utilities/sh/lexer.h index 57fb30b..b8ca95c 100644 --- a/userland/minibox/utilities/sh/lexer.h +++ b/userland/minibox/utilities/sh/lexer.h @@ -1,6 +1,7 @@ #ifndef LEXER_H #define LEXER_H #include <stddef.h> +#include <tb/sv.h> typedef enum { TOKEN_CHARS, @@ -14,11 +15,11 @@ typedef enum { struct TOKEN { token_type_t type; - char string_rep[256]; + struct sv string_rep; struct TOKEN *next; }; -struct TOKEN *lex(const char *code); +struct TOKEN *lex(struct sv code); struct AST *generate_ast(struct TOKEN *token); void free_tokens(struct TOKEN *token); #endif // LEXER_H |