Lines Matching refs:hir
9 use hir::{self, Error, ErrorKind, Hir};
149 ClassUnicode(hir::ClassUnicode),
157 ClassBytes(hir::ClassBytes),
197 fn unwrap_class_unicode(self) -> hir::ClassUnicode { in unwrap_class_unicode()
210 fn unwrap_class_bytes(self) -> hir::ClassBytes { in unwrap_class_bytes()
248 let cls = hir::ClassUnicode::empty(); in visit_pre()
251 let cls = hir::ClassBytes::empty(); in visit_pre()
305 let hcls = hir::Class::Unicode(cls); in visit_post()
309 let hcls = hir::Class::Bytes(cls); in visit_post()
314 let cls = hir::Class::Unicode(self.hir_unicode_class(x)?); in visit_post()
331 let expr = Hir::class(hir::Class::Unicode(cls)); in visit_post()
347 let expr = Hir::class(hir::Class::Bytes(cls)); in visit_post()
390 let cls = hir::ClassUnicode::empty(); in visit_class_set_item_pre()
393 let cls = hir::ClassBytes::empty(); in visit_class_set_item_pre()
413 cls.push(hir::ClassUnicodeRange::new(x.c, x.c)); in visit_class_set_item_post()
418 cls.push(hir::ClassBytesRange::new(byte, byte)); in visit_class_set_item_post()
425 cls.push(hir::ClassUnicodeRange::new(x.start.c, x.end.c)); in visit_class_set_item_post()
431 cls.push(hir::ClassBytesRange::new(start, end)); in visit_class_set_item_post()
439 cls.push(hir::ClassUnicodeRange::new(s, e)); in visit_class_set_item_post()
448 cls.push(hir::ClassBytesRange::new(s as u8, e as u8)); in visit_class_set_item_post()
509 let cls = hir::ClassUnicode::empty(); in visit_class_set_binary_op_pre()
512 let cls = hir::ClassBytes::empty(); in visit_class_set_binary_op_pre()
523 let cls = hir::ClassUnicode::empty(); in visit_class_set_binary_op_in()
526 let cls = hir::ClassBytes::empty(); in visit_class_set_binary_op_in()
638 byte @ hir::Literal::Byte(_) => return Ok(Hir::literal(byte)), in hir_literal()
639 hir::Literal::Unicode(ch) => ch, in hir_literal()
656 fn literal_to_char(&self, lit: &ast::Literal) -> Result<hir::Literal> { in literal_to_char()
658 return Ok(hir::Literal::Unicode(lit.c)); in literal_to_char()
661 None => return Ok(hir::Literal::Unicode(lit.c)), in literal_to_char()
665 return Ok(hir::Literal::Unicode(byte as char)); in literal_to_char()
670 Ok(hir::Literal::Byte(byte)) in literal_to_char()
677 Ok(Hir::literal(hir::Literal::Unicode(c))) in hir_from_char()
695 hir::ClassUnicode::new(vec![hir::ClassUnicodeRange::new( in hir_from_char_case_insensitive()
701 Ok(Hir::class(hir::Class::Unicode(cls))) in hir_from_char_case_insensitive()
712 hir::ClassBytes::new(vec![hir::ClassBytesRange::new( in hir_from_char_case_insensitive()
716 Ok(Hir::class(hir::Class::Bytes(cls))) in hir_from_char_case_insensitive()
737 hir::Anchor::StartLine in hir_assertion()
739 hir::Anchor::StartText in hir_assertion()
742 hir::Anchor::EndLine in hir_assertion()
744 hir::Anchor::EndText in hir_assertion()
747 Hir::anchor(hir::Anchor::StartText) in hir_assertion()
749 ast::AssertionKind::EndText => Hir::anchor(hir::Anchor::EndText), in hir_assertion()
752 hir::WordBoundary::Unicode in hir_assertion()
754 hir::WordBoundary::Ascii in hir_assertion()
759 hir::WordBoundary::UnicodeNegate in hir_assertion()
769 hir::WordBoundary::AsciiNegate in hir_assertion()
778 hir::GroupKind::CaptureIndex(idx) in hir_group()
781 hir::GroupKind::CaptureName { in hir_group()
786 ast::GroupKind::NonCapturing(_) => hir::GroupKind::NonCapturing, in hir_group()
788 Hir::group(hir::Group { kind: kind, hir: Box::new(expr) }) in hir_group()
793 ast::RepetitionKind::ZeroOrOne => hir::RepetitionKind::ZeroOrOne, in hir_repetition()
794 ast::RepetitionKind::ZeroOrMore => hir::RepetitionKind::ZeroOrMore, in hir_repetition()
795 ast::RepetitionKind::OneOrMore => hir::RepetitionKind::OneOrMore, in hir_repetition()
797 hir::RepetitionKind::Range(hir::RepetitionRange::Exactly(m)) in hir_repetition()
800 hir::RepetitionKind::Range(hir::RepetitionRange::AtLeast(m)) in hir_repetition()
806 hir::RepetitionKind::Range(hir::RepetitionRange::Bounded(m, n)) in hir_repetition()
811 Hir::repetition(hir::Repetition { in hir_repetition()
814 hir: Box::new(expr), in hir_repetition()
821 ) -> Result<hir::ClassUnicode> { in hir_unicode_class()
859 ) -> Result<hir::ClassUnicode> { in hir_perl_unicode_class()
881 ) -> hir::ClassBytes { in hir_perl_byte_class()
905 result: unicode::Result<hir::ClassUnicode>, in convert_unicode_class_error()
906 ) -> Result<hir::ClassUnicode> { in convert_unicode_class_error()
927 class: &mut hir::ClassUnicode, in unicode_fold_and_negate()
948 class: &mut hir::ClassBytes, in bytes_fold_and_negate()
970 hir::Literal::Byte(byte) => Ok(byte), in class_literal_byte()
971 hir::Literal::Unicode(ch) => { in class_literal_byte()
1070 fn hir_ascii_class_bytes(kind: &ast::ClassAsciiKind) -> hir::ClassBytes { in hir_ascii_class_bytes()
1074 .map(|(s, e)| hir::ClassBytesRange::new(s as u8, e as u8)) in hir_ascii_class_bytes()
1076 hir::ClassBytes::new(ranges) in hir_ascii_class_bytes()
1110 use hir::{self, Hir, HirKind};
1121 kind: hir::ErrorKind,
1124 impl PartialEq<hir::Error> for TestError {
1125 fn eq(&self, other: &hir::Error) -> bool { in eq()
1130 impl PartialEq<TestError> for hir::Error {
1148 fn t_err(pattern: &str) -> hir::Error { in t_err()
1170 .map(hir::Literal::Unicode) in hir_lit()
1181 1 => Hir::literal(hir::Literal::Byte(s[0])), in hir_blit()
1186 .map(hir::Literal::Byte) in hir_blit()
1195 Hir::group(hir::Group { in hir_group()
1196 kind: hir::GroupKind::CaptureIndex(i), in hir_group()
1197 hir: Box::new(expr), in hir_group()
1202 Hir::group(hir::Group { in hir_group_name()
1203 kind: hir::GroupKind::CaptureName { in hir_group_name()
1207 hir: Box::new(expr), in hir_group_name()
1212 Hir::group(hir::Group { in hir_group_nocap()
1213 kind: hir::GroupKind::NonCapturing, in hir_group_nocap()
1214 hir: Box::new(expr), in hir_group_nocap()
1219 Hir::repetition(hir::Repetition { in hir_quest()
1220 kind: hir::RepetitionKind::ZeroOrOne, in hir_quest()
1222 hir: Box::new(expr), in hir_quest()
1227 Hir::repetition(hir::Repetition { in hir_star()
1228 kind: hir::RepetitionKind::ZeroOrMore, in hir_star()
1230 hir: Box::new(expr), in hir_star()
1235 Hir::repetition(hir::Repetition { in hir_plus()
1236 kind: hir::RepetitionKind::OneOrMore, in hir_plus()
1238 hir: Box::new(expr), in hir_plus()
1242 fn hir_range(greedy: bool, range: hir::RepetitionRange, expr: Hir) -> Hir { in hir_range()
1243 Hir::repetition(hir::Repetition { in hir_range()
1244 kind: hir::RepetitionKind::Range(range), in hir_range()
1246 hir: Box::new(expr), in hir_range()
1260 Hir::class(hir::Class::Unicode(unicode::class(query).unwrap())) in hir_uclass_query()
1265 Hir::class(hir::Class::Unicode(unicode::perl_word().unwrap())) in hir_uclass_perl_word()
1269 let ranges: Vec<hir::ClassUnicodeRange> = ranges in hir_uclass()
1271 .map(|&(s, e)| hir::ClassUnicodeRange::new(s, e)) in hir_uclass()
1273 Hir::class(hir::Class::Unicode(hir::ClassUnicode::new(ranges))) in hir_uclass()
1277 let ranges: Vec<hir::ClassBytesRange> = ranges in hir_bclass()
1279 .map(|&(s, e)| hir::ClassBytesRange::new(s, e)) in hir_bclass()
1281 Hir::class(hir::Class::Bytes(hir::ClassBytes::new(ranges))) in hir_bclass()
1285 let ranges: Vec<hir::ClassBytesRange> = ranges in hir_bclass_from_char()
1290 hir::ClassBytesRange::new(s as u8, e as u8) in hir_bclass_from_char()
1293 Hir::class(hir::Class::Bytes(hir::ClassBytes::new(ranges))) in hir_bclass_from_char()
1318 use hir::Class::{Bytes, Unicode}; in hir_union()
1323 Hir::class(hir::Class::Unicode(c1)) in hir_union()
1327 Hir::class(hir::Class::Bytes(c1)) in hir_union()
1335 use hir::Class::{Bytes, Unicode}; in hir_difference()
1340 Hir::class(hir::Class::Unicode(c1)) in hir_difference()
1344 Hir::class(hir::Class::Bytes(c1)) in hir_difference()
1350 fn hir_anchor(anchor: hir::Anchor) -> Hir { in hir_anchor()
1354 fn hir_word(wb: hir::WordBoundary) -> Hir { in hir_word()
1412 kind: hir::ErrorKind::UnicodeNotAllowed, in literal()
1422 kind: hir::ErrorKind::InvalidUtf8, in literal()
1502 kind: hir::ErrorKind::UnicodeNotAllowed, in literal_case_insensitive()
1528 kind: hir::ErrorKind::InvalidUtf8, in dot()
1538 kind: hir::ErrorKind::InvalidUtf8, in dot()
1549 assert_eq!(t("^"), hir_anchor(hir::Anchor::StartText)); in assertions()
1550 assert_eq!(t("$"), hir_anchor(hir::Anchor::EndText)); in assertions()
1551 assert_eq!(t(r"\A"), hir_anchor(hir::Anchor::StartText)); in assertions()
1552 assert_eq!(t(r"\z"), hir_anchor(hir::Anchor::EndText)); in assertions()
1553 assert_eq!(t("(?m)^"), hir_anchor(hir::Anchor::StartLine)); in assertions()
1554 assert_eq!(t("(?m)$"), hir_anchor(hir::Anchor::EndLine)); in assertions()
1555 assert_eq!(t(r"(?m)\A"), hir_anchor(hir::Anchor::StartText)); in assertions()
1556 assert_eq!(t(r"(?m)\z"), hir_anchor(hir::Anchor::EndText)); in assertions()
1558 assert_eq!(t(r"\b"), hir_word(hir::WordBoundary::Unicode)); in assertions()
1559 assert_eq!(t(r"\B"), hir_word(hir::WordBoundary::UnicodeNegate)); in assertions()
1560 assert_eq!(t(r"(?-u)\b"), hir_word(hir::WordBoundary::Ascii)); in assertions()
1563 hir_word(hir::WordBoundary::AsciiNegate) in assertions()
1569 kind: hir::ErrorKind::InvalidUtf8, in assertions()
1679 hir_anchor(hir::Anchor::StartLine), in flags()
1687 hir_anchor(hir::Anchor::StartLine), in flags()
1689 hir_anchor(hir::Anchor::StartText), in flags()
1744 hir_range(true, hir::RepetitionRange::Exactly(1), hir_lit("a"),) in repetition()
1748 hir_range(true, hir::RepetitionRange::AtLeast(1), hir_lit("a"),) in repetition()
1752 hir_range(true, hir::RepetitionRange::Bounded(1, 2), hir_lit("a"),) in repetition()
1756 hir_range(false, hir::RepetitionRange::Exactly(1), hir_lit("a"),) in repetition()
1760 hir_range(false, hir::RepetitionRange::AtLeast(1), hir_lit("a"),) in repetition()
1766 hir::RepetitionRange::Bounded(1, 2), in repetition()
1927 kind: hir::ErrorKind::InvalidUtf8, in class_ascii()
1937 kind: hir::ErrorKind::InvalidUtf8, in class_ascii()
2060 kind: hir::ErrorKind::UnicodePerlClassNotFound, in class_perl_word_disabled()
2075 kind: hir::ErrorKind::UnicodePerlClassNotFound, in class_perl_space_disabled()
2093 kind: hir::ErrorKind::UnicodePerlClassNotFound, in class_perl_digit_disabled()
2167 kind: hir::ErrorKind::UnicodeNotAllowed, in class_unicode_gencat()
2177 kind: hir::ErrorKind::UnicodeNotAllowed, in class_unicode_gencat()
2187 kind: hir::ErrorKind::UnicodePropertyNotFound, in class_unicode_gencat()
2197 kind: hir::ErrorKind::UnicodePropertyNotFound, in class_unicode_gencat()
2207 kind: hir::ErrorKind::UnicodePropertyValueNotFound, in class_unicode_gencat()
2222 kind: hir::ErrorKind::UnicodePropertyNotFound, in class_unicode_gencat_disabled()
2233 kind: hir::ErrorKind::UnicodePropertyNotFound, in class_unicode_gencat_disabled()
2265 kind: hir::ErrorKind::UnicodePropertyValueNotFound, in class_unicode_script()
2275 kind: hir::ErrorKind::UnicodePropertyValueNotFound, in class_unicode_script()
2290 kind: hir::ErrorKind::UnicodePropertyNotFound, in class_unicode_script_disabled()
2301 kind: hir::ErrorKind::UnicodePropertyNotFound, in class_unicode_script_disabled()
2316 kind: hir::ErrorKind::UnicodePropertyValueNotFound, in class_unicode_age()
2331 kind: hir::ErrorKind::EmptyClassNotAllowed, in class_unicode_any_empty()
2346 kind: hir::ErrorKind::UnicodePropertyNotFound, in class_unicode_age_disabled()
2481 kind: hir::ErrorKind::InvalidUtf8, in class_bracketed()
2492 kind: hir::ErrorKind::EmptyClassNotAllowed, in class_bracketed()
2503 kind: hir::ErrorKind::EmptyClassNotAllowed, in class_bracketed()
2660 kind: hir::ErrorKind::EmptyClassNotAllowed, in class_bracketed_nested()
2671 kind: hir::ErrorKind::EmptyClassNotAllowed, in class_bracketed_nested()
2894 hir::RepetitionRange::Bounded(5, 10), in ignore_whitespace()