Merge branch 'master' of github.com:h3rald/hex
h3rald h3rald@h3rald.com
Wed, 11 Dec 2024 21:51:17 +0000
3 files changed,
20 insertions(+),
6 deletions(-)
M
scripts/test.hex
→
scripts/test.hex
@@ -218,6 +218,9 @@ (((0x2) 0x2 get) (error) try "Index out of range" ==)
((() 0x0 get) (error) try "Index out of range" ==) ((0x4 0x4 get) (error) try "Symbol 'get' requires a quotation or a string" ==) ;120 + + ("a/b/c" "t-path" : (t-path "/" index 0x0 >=) (t-path "/" "\\" replace "t-path" :) while t-path "a\\b\\c" == "t-path" #) + ("assets\"" "\"" "/" replace "assets/" ==) ) "tests" :
M
scripts/web.hex
→
scripts/web.hex
@@ -103,7 +103,6 @@ ; Process home page
d-out "/index.html" cat "dst-file" : ) ( - ("sh -c \"mkdir -p " d-out "/" id-content "\"") () map "" join exec (d-out id-content "index.html") () map "/" join "dst-file" : ) if@@ -113,7 +112,7 @@ ) each
; Write assets -("sh -c \"mkdir -p " d-out "/assets\"") () map "" join exec +("sh -c \"mkdir -p " d-out "/assets\"") () map "" join exec assets ( "fn-asset" :
M
src/hex.c
→
src/hex.c
@@ -214,9 +214,9 @@ break;
case 'v': *dst++ = '\v'; break; - case '\\': - *dst++ = '\\'; - break; + // case '\\': + // *dst++ = '\\'; + // break; case '\"': *dst++ = '\"'; break;@@ -628,6 +628,12 @@ ptr += 2;
len++; position->column += 2; } + if (*ptr == '\\' && *(ptr + 1) == '\\') + { + ptr += 2; + len++; + position->column += 2; + } else if (*ptr == '"') { break;@@ -663,7 +669,13 @@
ptr = start; while (*ptr != '\0' && *ptr != '"') { - if (*ptr == '\\' && *(ptr + 1) == '"') + if (*ptr == '\\' && *(ptr + 1) == '\\') + { + *dst++ = '\\'; + *dst++ = '\\'; + ptr += 2; + } + else if (*ptr == '\\' && *(ptr + 1) == '"') { *dst++ = '"'; ptr += 2;