Forbid escapable characters in string literals
This commit is contained in:
parent
3130736057
commit
dfaa878820
1 changed files with 1 additions and 1 deletions
|
|
@ -81,7 +81,7 @@ fn num_lit() -> impl Parser<char, NumLit, Error = Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn string_lit_elem() -> impl Parser<char, StringLitElem, Error = Error> {
|
fn string_lit_elem() -> impl Parser<char, StringLitElem, Error = Error> {
|
||||||
let plain = filter(|c: &char| !matches!(c, '"' | '\\'))
|
let plain = filter(|c: &char| !matches!(c, '\\' | '"' | '\t' | '\r' | '\n'))
|
||||||
.repeated()
|
.repeated()
|
||||||
.at_least(1)
|
.at_least(1)
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue