Gidsss / UwUIDE

A compiler made to be cute uwu >~<
6 stars 0 forks source link

Fix/escaped char transpilation #306

Closed am-cid closed 3 months ago

am-cid commented 3 months ago

escaped char transpilation is simpler now

"\\\"\n\t\r\b\f" --> "\\\"\n\t\r\b\f" (python will handle escaping this during execution)
"\|" --> | (we escape this in lexer)

test log

source

sample text file
-----------------------------------------------------------------------------------
1 |
2 | fwunc mainuwu-san() [[
3 |     a-chan = 1~
4 |     pwint("abs {\\\"one\\\"}:<newline>\n<tab>\t \|| a|\|")~
5 |     pwint("\n")~
6 |     pwint("abs \\\"one\\\":<newline>\n<tab>\t<back>\b<return>\r<feed>\f\|\|")~
7 | ]]
8 |
9 |
10 |
-----------------------------------------------------------------------------------
end of file

transpiled

image

output

image