Skip to content

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

@parasyte

Description

@parasyte

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions