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

Add support for \e escape sequences in c# strings and characters #297

Merged
merged 2 commits into from
Nov 5, 2023

Conversation

JoeRobich
Copy link
Member

See proposal for more details dotnet/csharplang#7400

@wise0704
Copy link
Contributor

One thought: unknown escape sequences are simply illegal (compile time error) instead of being treated as normal string, i.e.

string text = "test \c 123"; // error CS1009: Unrecognized escape sequence

So would it be better to just treat all \. that do not match the special forms (e.g. u, U, x) as "attempted" escape characters?

@JoeRobich JoeRobich force-pushed the dev/jorobich/support-e-escape-sequence branch from d1a2b2e to 7bf5709 Compare November 5, 2023 21:56
@JoeRobich
Copy link
Member Author

So would it be better to just treat all . that do not match the special forms (e.g. u, U, x) as "attempted" escape characters?

Sure. It would also match other grammars such as TypeScript.

@JoeRobich JoeRobich merged commit 0febdc7 into main Nov 5, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants