Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,21 @@ bumpalo = "3.20.3"
pathsearch = "0.2.0"
base64 = "0.23.0"
ordered-float = "5.3.0"
pest = "2.8.6"
pest_derive = "2.8.6"
pretty = "0.12.5"
pretty_assertions = "1.4.1"
zstd = "0.13.2"
relrc = "0.5.0"
wyhash = "0.6.0"
fxhash = "0.2.1"
schemars = "1.2.1"
# Pinned at pre-2.9.0 due to a big slowdown in the newer versions.
#
# The `serialization/t_factory/sexpr/without_extensions/decode` and `simple_cfg`
# benchmarks had a ~20% slowdown.
#
# We should try updating later versions once the performance issue is resolved.
pest = "=2.8.8"
pest_derive = "=2.8.8"

# These public dependencies usually require breaking changes downstream, so we
# try to be as permissive as possible.
Expand Down
3 changes: 2 additions & 1 deletion hugr-model/src/v0/ast/hugr.pest
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ reserved = @{
}

literal_string = ${ "\"" ~ (literal_string_raw | literal_string_escape | literal_string_unicode)* ~ "\"" }
literal_string_raw = @{ (!("\\" | "\"") ~ ANY)+ }
// Spell `X+` as `X ~ X*` so pest can optimize the repetition into `skip_until`.
literal_string_raw = @{ (!("\\" | "\"") ~ ANY) ~ (!("\\" | "\"") ~ ANY)* }
literal_string_escape = @{ "\\" ~ ("\"" | "\\" | "n" | "r" | "t") }
literal_string_unicode = @{ "\\u" ~ "{" ~ ASCII_HEX_DIGIT+ ~ "}" }

Expand Down
Loading