Add string escaping

This commit is contained in:
bʰedoh₂ swé 2024-06-11 05:37:21 +05:00
parent e8ca2af9bc
commit 00afc5158f

View File

@ -17,6 +17,7 @@ tSyntaxElement* parse(FILE* file) {
bool incomment = false;
bool instring = false;
bool intoken = false;
bool inescape = false;
tExtstring* exttoken = NULL;
tExtstring* extstring = NULL;
@ -34,7 +35,7 @@ tSyntaxElement* parse(FILE* file) {
}
if (instring) {
if (symbol == '"') {
if (symbol == '"' && !inescape) {
if (extstring == NULL) {
extstring = malloc(sizeof(tExtstring));
@ -52,6 +53,10 @@ tSyntaxElement* parse(FILE* file) {
} else {
inescape = false;
if (symbol == '\\')
inescape = true;
if (extstring == NULL) {
extstring = malloc(sizeof(tExtstring));