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

Improve raw strings #30

Open
fuchsnj opened this issue Aug 24, 2022 · 0 comments
Open

Improve raw strings #30

fuchsnj opened this issue Aug 24, 2022 · 0 comments
Labels
type: enhancement A value-adding code change that enhances its existing functionality vrl: parser Changes to the syntax parser

Comments

@fuchsnj
Copy link
Member

fuchsnj commented Aug 24, 2022

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

Today the backslash (\) behavior inside raw strings can be confusing / inconsistent. The docs claim that backslashes have "no special meaning", however a backslash currently causes the parser to always include the next character (including the backslash itself). That means a blackslash can be used to include a single quote inside of a raw string, but this comes with some odd edge cases:

  1. A single quote can't be included in a raw string without a leading backslash
  2. The last character of a raw string cannot be a backslash

It would be nice if these restrictions could be lifted and a backslash actually had no special meaning.

Proposal

One possible solution is to allow raw string literals similar to Rust, where you can create a custom delimiter out of multiple characters, which would allow anything to be used inside of the raw string literal.

Version

0.23.0

@fuchsnj fuchsnj added type: enhancement A value-adding code change that enhances its existing functionality vrl: parser Changes to the syntax parser labels Aug 24, 2022
@fuchsnj fuchsnj transferred this issue from vectordotdev/vector Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A value-adding code change that enhances its existing functionality vrl: parser Changes to the syntax parser
Projects
None yet
Development

No branches or pull requests

1 participant