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 strings are not supported in #[footer] attrs #32

Open
parasyte opened this issue Feb 12, 2024 · 0 comments
Open

Raw strings are not supported in #[footer] attrs #32

parasyte opened this issue Feb 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@parasyte
Copy link
Owner

parasyte commented Feb 12, 2024

This is a limitation in LiteralExt::as_string(): https://github.com/parasyte/myn/blob/680794d1ea0052fc6fd1a7b9b20e77ae544bb8da/src/traits.rs#L193-L207

Should be fairly easy to fix. The parser just needs to be taught about raw string syntax, including arbitrary # characters surrounding the string literal.

Some examples:

#[footer = r"Boring raw string literal."]
#[footer = r#"A raw string literal that ignores "double quotes"."#]
#[footer = r##"A raw string literal that ignores #"hashed double quotes"#."##]
#[footer = r###"A raw string literal that ignores ##"double hashed double quotes"##."###]
// etc.

The current workaround is to use escape sequences in normal string literals.

@parasyte parasyte added the bug Something isn't working label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant