-
Notifications
You must be signed in to change notification settings - Fork 143
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
Regex matching panic #508
Comments
can you clarify this, please? using presumably the does it make a difference if you use Oniguruma with the ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND flag set, instead of fancy regex? https://github.com/denoland/deno_doc/blob/simplify-syntect/Cargo.toml#L43C160-L43C160 ( |
my bad, yes, that is what I meant.
Tried (without needing to set the onig flag manually), and seems to work fine, so we'll be using that instead for now, though we don't really want to depend on yet another regex library.
Hm it is still odd that with the small reproducible example this doesn't to not panic, but with the deno_doc project it does, so seems like something weird must happening somewhere |
@keith-hall |
This fork doesn't panic on non compiling regexes. Fix #967 The reason the fork is needed is that syntect panics when a regex from a syntax can't compile, which happens with sublime syntaxes when the engine isn't onig but fancy-regex. The default regex engine of syntect is onig, but this unmaintained engine isn't pure-rust and isn't compatible with gcc 15, which limits compatibility for broot. So, right now, this fork is useful to prevent crashes. The ideal solution would be either to have syntect completely handle regex compiling errors without panic (which looks easily doable but requires some work and may not appear as the best behavior for some other crates using syntect) and|or to have fancy-regex support all the regex features that are required by sublime syntaxes. See also: * fancy-regex/fancy-regex#74 * sharkdp/bat#3156 * #956 * trishume/syntect#508
I am getting a panic on https://github.com/denoland/deno_doc/tree/simplify-syntect (can be reproduced with
cargo run --example ddoc --features=html -- --name "" --html ./panic.ts --output gen
)(full panic here).
I tried making a small reproducible example with
comrak
, however that does not panic, even though thecomrak
&syntect
logic used is identical between it anddeno_doc
. tried withsyntect
directly, and still no panic, so unsure what is happening.I debugged a bit, and for some reason with the
deno_doc
build, theusing
keyword does not seem to work, but not an issue with the smaller reproduction. I checked, and the typescript syntax does support the keyword.I am using the typescript syntax as described in #97 (comment).
The text was updated successfully, but these errors were encountered: