summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-12-15 03:24:29 +0100
committerAnton Kling <anton@kling.gg>2024-12-15 03:24:29 +0100
commitb26125c7c9163410bd11193909f04106f0582dc9 (patch)
treebe85fde036474ab1821834599587a4e5413a135b
parente28b7b21d308d7963aea6317a0a83e9de6ac0f45 (diff)
sh: Partially working strings using ""
-rw-r--r--userland/minibox/utilities/sh/lexer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/userland/minibox/utilities/sh/lexer.c b/userland/minibox/utilities/sh/lexer.c
index 52126b4..8e404a3 100644
--- a/userland/minibox/utilities/sh/lexer.c
+++ b/userland/minibox/utilities/sh/lexer.c
@@ -29,6 +29,15 @@ int is_special_char(char c) {
int parse_chars(struct sv *code_ptr, struct TOKEN *cur) {
struct sv code = *code_ptr;
+
+ if (sv_partial_eq(code, C_TO_SV("\""))) {
+ sv_take(code, &code, 1);
+ cur->type = TOKEN_CHARS;
+ cur->string_rep = sv_split_delim(code, &code, '"');
+ *code_ptr = code;
+ return 1;
+ }
+
if (is_special_char(sv_peek(code))) {
return 0;
}