Skip to content

Commit

Permalink
disallow newlines etc in additional property names
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Dec 6, 2024
1 parent db98320 commit 8d7517b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser/src/json/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ impl Compiler {
let valid = self
.builder
.regex
.regex(r#""([^"\\]|\\["\\/bfnrt]|\\u[0-9a-fA-F]{4})*""#.to_string());
.regex(format!("\"({})*\"", CHAR_REGEX));
let valid_and_not_taken = self.builder.regex.and(vec![valid, not_taken]);
let rx = RegexSpec::RegexId(valid_and_not_taken);
self.builder.lexeme(rx, false)
Expand Down

0 comments on commit 8d7517b

Please sign in to comment.