all repos — hex @ 29d1cadf2dd23315178e1fd4013edc7219e63fa2

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Merge branch 'master' of github.com:h3rald/hex
h3rald h3rald@h3rald.com
Wed, 11 Dec 2024 21:51:17 +0000
commit

29d1cadf2dd23315178e1fd4013edc7219e63fa2

parent

e007c2df2189d02eebd481558449c55c21cca221

3 files changed, 20 insertions(+), 6 deletions(-)

jump to
M scripts/test.hexscripts/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.hexscripts/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.csrc/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;