Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backslashes \\\\ are hard to understand #696

Open
guigui0246 opened this issue Jul 8, 2024 · 0 comments
Open

Backslashes \\\\ are hard to understand #696

guigui0246 opened this issue Jul 8, 2024 · 0 comments

Comments

@guigui0246
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant