rouge icon indicating copy to clipboard operation
rouge copied to clipboard

Rust lexer does not support string continuation escapes

Open Jisu-Woniu opened this issue 11 months ago • 1 comments

Name of the lexer Rust

Code sample A sample of the code that produces the bug.

const REQUEST: &[u8] = b"GET http://example.com/ HTTP/1.1\r\n\
    Host: example.com\r\n\
    Accept: */*\r\n\
    \r\n";

It also helps if you can provide a link to a code sample on rouge.jneen.net.

Additional context The REQUEST is a valid Rust string literal, as described in The Rust Reference, backslash at the end of line has special meaning in Rust.

Jisu-Woniu avatar Jan 19 '25 12:01 Jisu-Woniu

One more example taken from The Rust Reference:

let a = "foobar";
let b = "foo\
         bar";
let c = "foo\

     bar";

playground

Jisu-Woniu avatar Jan 19 '25 12:01 Jisu-Woniu