Lines Matching defs:Hir

24 /// An error that can occur while translating an `Ast` to a `Hir`.
55 /// The type of an error that occurred while building an `Hir`.
163 /// on this `Hir` type instead of building the `HirKind` values directly.
171 /// Also, an `Hir`'s `fmt::Display` implementation prints an HIR as a regular
173 /// proportional to the size of the `Hir`.
175 pub struct Hir {
182 /// The kind of an arbitrary `Hir` expression.
208 Concat(Vec<Hir>),
214 Alternation(Vec<Hir>),
217 impl Hir {
233 pub fn empty() -> Hir {
246 Hir { kind: HirKind::Empty, info }
254 pub fn literal(lit: Literal) -> Hir {
271 Hir { kind: HirKind::Literal(lit), info }
275 pub fn class(class: Class) -> Hir {
288 Hir { kind: HirKind::Class(class), info }
292 pub fn anchor(anchor: Anchor) -> Hir {
321 Hir { kind: HirKind::Anchor(anchor), info }
325 pub fn word_boundary(word_boundary: WordBoundary) -> Hir {
348 Hir { kind: HirKind::WordBoundary(word_boundary), info }
352 pub fn repetition(rep: Repetition) -> Hir {
375 Hir { kind: HirKind::Repetition(rep), info }
379 pub fn group(group: Group) -> Hir {
392 Hir { kind: HirKind::Group(group), info }
398 pub fn concat(mut exprs: Vec<Hir>) -> Hir {
400 0 => Hir::empty(),
483 Hir { kind: HirKind::Concat(exprs), info }
491 pub fn alternation(mut exprs: Vec<Hir>) -> Hir {
493 0 => Hir::empty(),
545 Hir { kind: HirKind::Alternation(exprs), info }
558 pub fn dot(bytes: bool) -> Hir {
563 Hir::class(Class::Bytes(cls))
568 Hir::class(Class::Unicode(cls))
580 pub fn any(bytes: bool) -> Hir {
584 Hir::class(Class::Bytes(cls))
588 Hir::class(Class::Unicode(cls))
702 /// use the `is_match_empty` method on [`Hir`](struct.Hir.html).
727 /// Print a display representation of this Hir.
732 /// to the size of the `Hir`.
733 impl fmt::Display for Hir {
1345 pub hir: Box<Hir>,
1383 pub hir: Box<Hir>,
1395 /// [`Hir`](struct.Hir.html).
1433 /// space but heap space proportional to the depth of the total `Hir`.
1434 impl Drop for Hir {
1451 let mut stack = vec![mem::replace(self, Hir::empty())];
1460 stack.push(mem::replace(&mut x.hir, Hir::empty()));
1463 stack.push(mem::replace(&mut x.hir, Hir::empty()));
2250 Hir::literal(Literal::Byte(b'a'));
2254 // for Hir can handle arbitrarily sized expressions in constant stack
2263 let mut expr = Hir::empty();
2265 expr = Hir::group(Group {
2269 expr = Hir::repetition(Repetition {
2275 expr = Hir {
2279 expr = Hir {