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

Raw string literal #321

Closed
dalance opened this issue Apr 6, 2024 · 2 comments
Closed

Raw string literal #321

dalance opened this issue Apr 6, 2024 · 2 comments

Comments

@dalance
Copy link

dalance commented Apr 6, 2024

I want to add raw string literal support like Rust or C#.

// Rust style
r##"..."##

// C# style
"""..."""

In this case, the count of delimiter (# or ") will be adjusted to the contents.
So I think this pattern can't be written by regex without backreference.

Do you have any idea to implement this feature?

@jsinger67
Copy link
Owner

You can't ensure that start and end delimiters have the same counts with regexes alone because this is no regular language anymore.
Best way would be you check this in the grammar processing.

@dalance
Copy link
Author

dalance commented Apr 6, 2024

Thank you for your suggestion.
I'll try it.

@dalance dalance closed this as completed Apr 6, 2024
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

2 participants