Added linebreak escape character

This commit is contained in:
Devine Lu Linvega 2024-04-08 16:13:19 -07:00
parent e786cdce58
commit accc108817
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,4 @@
<> (greeting) (Melcome to)
<> (name) (Modal --)
<> (?: ?: -- print) ()
<> (lang_name) (Modal)
<> (?: print) ()
greeting name print
(Welcome to lang_name \nHave fun! \n) print

View File

@ -65,7 +65,11 @@ set_reg(int r, char *b)
} else if(r == ':') {
char *bb = walk(b);
if(*b == '(') b++, --bb;
while(b < bb) putc(*(b++), stdout);
while(b < bb) {
char c = *(b++);
if(c == '\\' && *(b++) == 'n') c = 0xa;
putc(c, stdout);
}
} else
regs[r] = b;
return 1;