GulfOfMexico
GulfOfMexico copied to clipboard
Backslashes \\\\ are hard to understand
Lokk at this code how you define \n to \n\n :
const const \\n: Regex<\\\\n\\e[95m\\n> = \\n\e[95m\n
assert \\n == \\n\e[95m\n
That's too much \ The compiler should use the word "\backslash/" when you want to use the \ functionnality and the word "\end-of-line/" for the end of line:
const const \n: Regex<\\n\e[95m\n> = \n\backslash/e[95m\end-of-line/
assert \n == \n\backslash/e[95m\end-of-line/
Notes:
- The backslash and slash are here to still allow you to type backslash and end-of-line, if you want to type "\backslash/" use "\backslash/\backslash/"
- The regex do not change it's behavior so it can be ~~copie-pasted from~~ used in other programs