From ad8619ae362b4b626e99b90b1b7c4d7e59125f65 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 2 May 2024 16:52:26 +0200 Subject: sh: Use string view instead of C strings --- userland/minibox/utilities/sh/lexer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'userland/minibox/utilities/sh/lexer.h') 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 +#include 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 -- cgit v1.2.3