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

Rust lexer does not support string continuation escapes #2102

Open
Jisu-Woniu opened this issue Jan 19, 2025 · 1 comment
Open

Rust lexer does not support string continuation escapes #2102

Jisu-Woniu opened this issue Jan 19, 2025 · 1 comment
Labels
bugfix-request A request for a bugfix to be developed.

Comments

@Jisu-Woniu
Copy link

Jisu-Woniu commented Jan 19, 2025

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 Jisu-Woniu added the bugfix-request A request for a bugfix to be developed. label Jan 19, 2025
@Jisu-Woniu
Copy link
Author

One more example taken from The Rust Reference:

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

     bar";

playground

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

No branches or pull requests

1 participant