diff --git a/examples/hello.modal b/examples/hello.modal index fef5e5c..f6adc9f 100644 --- a/examples/hello.modal +++ b/examples/hello.modal @@ -1,5 +1,4 @@ -<> (greeting) (Melcome to) -<> (name) (Modal --) -<> (?: ?: -- print) () +<> (lang_name) (Modal) +<> (?: print) () -greeting name print \ No newline at end of file +(Welcome to lang_name \nHave fun! \n) print diff --git a/src/modal.c b/src/modal.c index 88ead4e..500863e 100644 --- a/src/modal.c +++ b/src/modal.c @@ -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;