mirror of
https://github.com/fanzeyi/cargo-play
synced 2024-11-14 14:57:09 +00:00
13 lines
314 B
Rust
13 lines
314 B
Rust
use regex_syntax::hir::{self, Hir};
|
|
use regex_syntax::Parser;
|
|
|
|
fn main() {
|
|
let hir = Parser::new().parse("a|b").unwrap();
|
|
assert_eq!(
|
|
hir,
|
|
Hir::alternation(vec![
|
|
Hir::literal(hir::Literal::Unicode('a')),
|
|
Hir::literal(hir::Literal::Unicode('b')),
|
|
])
|
|
);
|
|
}
|