mirror of
https://github.com/janet-lang/janet
synced 2025-01-26 07:06:51 +00:00
Add parser escape sequences
This commit is contained in:
parent
b219b146fa
commit
d63379e777
@ -259,6 +259,14 @@ static int checkescape(uint8_t c) {
|
|||||||
return '\f';
|
return '\f';
|
||||||
case 'v':
|
case 'v':
|
||||||
return '\v';
|
return '\v';
|
||||||
|
case 'a':
|
||||||
|
return '\a';
|
||||||
|
case 'b':
|
||||||
|
return '\b';
|
||||||
|
case '\'':
|
||||||
|
return '\'';
|
||||||
|
case '?':
|
||||||
|
return '?';
|
||||||
case 'e':
|
case 'e':
|
||||||
return 27;
|
return 27;
|
||||||
case '"':
|
case '"':
|
||||||
|
@ -152,6 +152,12 @@ static void janet_escape_string_impl(JanetBuffer *buffer, const uint8_t *str, in
|
|||||||
case '\v':
|
case '\v':
|
||||||
janet_buffer_push_bytes(buffer, (const uint8_t *)"\\v", 2);
|
janet_buffer_push_bytes(buffer, (const uint8_t *)"\\v", 2);
|
||||||
break;
|
break;
|
||||||
|
case '\a':
|
||||||
|
janet_buffer_push_bytes(buffer, (const uint8_t *)"\\a", 2);
|
||||||
|
break;
|
||||||
|
case '\b':
|
||||||
|
janet_buffer_push_bytes(buffer, (const uint8_t *)"\\b", 2);
|
||||||
|
break;
|
||||||
case 27:
|
case 27:
|
||||||
janet_buffer_push_bytes(buffer, (const uint8_t *)"\\e", 2);
|
janet_buffer_push_bytes(buffer, (const uint8_t *)"\\e", 2);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user