- Notifications
You must be signed in to change notification settings - Fork 484
Closed
Labels
Description
What version of regex are you using?
regex-syntax 0.7.4
Describe the bug at a high level.
There are Ast
s that can be created that cause internal error
s to be panicked when being translated into Hir
.
These Ast's are nonsense, but can be generated using the Arbitrary
integration.
What are the steps to reproduce the behavior?
use regex_syntax::{ast::{Span, Position, Ast, Alternation, Concat}, hir::translate::Translator}; let span = Span::splat(Position::new(0, 0, 0)); let ast = Ast::Alternation(Alternation { span, asts: vec![Ast::Concat(Concat { span, asts: vec![] })], }); let mut t = Translator::new(); let hir_result = t.translate("", &ast);
What is the actual behavior?
panicked at 'internal error: entered unreachable code: expected expr or concat, got alt branch marker', /Users/conrad/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-syntax-0.7.4/src/hir/translate.rs:769:17
What is the expected behavior?
Return an error case from translate