Skip to content

panic with regex-fancy feature on one line JS files #3156

Open
@Canop

Description

With current main (commit 3e07483):

echo "let a = 0;" > crash.js
cargo run --no-default-features --features "clap,etcetera,paging,wild,regex-fancy" -- crash.js

results in

thread 'main' panicked at /home/dys/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syntect-5.2.0/src/parsing/regex.rs:70:53:
regex string should be pre-tested: ParseError(147, InvalidEscape("\\g"))

It may be due to https://github.com/sublimehq/Packages/blob/master/JavaScript/Indentation%20Rules.tmPreferences#L73

The reason I want to use regex-fancy is that the onig crate fails to build with gcc 15.

Background: I'm the author of another program using syntect, I have the same problem and just verified it was also happening in bat. A solution should apply to both bat and broot.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream-errorA bug in an upstream component

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions