txlyre 2 weeks ago
parent
commit
25e986acb5
1 changed files with 14 additions and 0 deletions
  1. 14 0
      qic.c

+ 14 - 0
qic.c

@@ -671,6 +671,20 @@ token_t *tokenize_string(char *source, size_t *pos, size_t *size) {
         break;
 
       default:
+        if (hx) {
+          hx = 0;
+
+          if (strchr("0123456789abcdefABCDEF", nc) != NULL) {
+            buffer_fmt(text, "\\x%x", nc);
+
+            hx = 1;
+
+            if (size) (*size)++;
+
+            continue;
+          }
+        }
+
         buffer_append(text, nc);
         break;
       }