You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parsing "(?m){1,1}" with regex-syntax 0.6.5 results in:
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:355:21
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:211
3: std::panicking::default_hook
at src/libstd/panicking.rs:227
4: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:491
5: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:398
6: rust_begin_unwind
at src/libstd/panicking.rs:325
7: core::panicking::panic_fmt
at src/libcore/panicking.rs:95
8: core::panicking::panic
at src/libcore/panicking.rs:59
9: <core::option::Option<T>>::unwrap
at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/libcore/macros.rs:20
10: <regex_syntax::hir::translate::TranslatorI<'t, 'p> as regex_syntax::ast::visitor::Visitor>::visit_post
at /home/adam/.cargo/registry/src/github.lhy31512.workers.dev-1ecc6299db9ec823/regex-syntax-0.6.5/src/hir/translate.rs:339
11: regex_syntax::ast::visitor::HeapVisitor::visit
at /home/adam/.cargo/registry/src/github.lhy31512.workers.dev-1ecc6299db9ec823/regex-syntax-0.6.5/src/ast/visitor.rs:261
12: regex_syntax::ast::visitor::visit
at /home/adam/.cargo/registry/src/github.lhy31512.workers.dev-1ecc6299db9ec823/regex-syntax-0.6.5/src/ast/visitor.rs:130
13: regex_syntax::hir::translate::Translator::translate
at /home/adam/.cargo/registry/src/github.lhy31512.workers.dev-1ecc6299db9ec823/regex-syntax-0.6.5/src/hir/translate.rs:143
14: regex_syntax::parser::Parser::parse
at /home/adam/.cargo/registry/src/github.lhy31512.workers.dev-1ecc6299db9ec823/regex-syntax-0.6.5/src/parser.rs:203
The text was updated successfully, but these errors were encountered:
This fixes a bug where the HIR translator would panic on regexes such as
`(?i){1}` since it assumes that every repetition operator has a valid
sub-expression, and `(?i)` is not actually a sub-expression (but is more
like a directive instead).
Previously, we fixed this same bug for *uncounted* repetitions in commit
17764ff (for bug #465), but we did not fix it for counted repetitions.
We apply the same fix here.
Fixes#555
Parsing "(?m){1,1}" with regex-syntax 0.6.5 results in:
The text was updated successfully, but these errors were encountered: