Lines Matching defs:byte

22 In pathological cases, a new state can be created for every byte of input.
104 /// and the set of empty-width flags set at the byte in the input when the
116 /// given state `s` and byte `b`, the next state can be found at index
129 /// permutations of flags set just before the initial byte of input. (The
153 /// It is laid out in row-major order, with states as rows and byte class
250 /// The flags are packed into the first byte of data.
259 /// it is packed into a single byte; Otherwise the byte 128 (-128 as an i8)
334 /// exists in the regex *and* a non-ASCII byte is observed.
415 // We add 1 to account for the special EOF byte.
586 // 6. We can't actually do state.next[byte]. Instead, we have to do
587 // state.next[byte_classes[byte]], which permits us to keep the
596 // reported as an index to the most recent byte that resulted in a
700 let byte = Byte::byte(text[at - 1]);
708 next_si = match self.next_state(qcur, qnext, prev_si, byte) {
810 let byte = Byte::byte(text[at]);
813 next_si = match self.next_state(qcur, qnext, prev_si, byte) {
857 // 1. The given byte of input (`text[i]`).
858 // 2. The class of the byte of input (`classes[text[i]]`).
870 // byte classes in the program. Therefore, a valid class leads to a
883 /// byte (which may be EOF).
905 // Before inspecting the current byte, we may need to also inspect
906 // whether the position immediately preceding the current byte
914 // Compute the flags immediately preceding the current byte.
917 // current byte and are handled below.)
939 // Now we set flags for immediately after the current byte. Since start
946 // matching by one byte in order to process the special EOF sentinel
947 // byte. Namely, if this DFA state containing a matching NFA state,
956 // the current byte.
960 // These states never happen in a byte-based program.
989 // If we're processing the last byte of the input and we're
1014 // delayed by one byte.
1039 /// corresponds to a real byte in the input, then only the start line
1050 /// line should be set if the preceding byte is `\n`. End line should never
1051 /// be set in this case. (Even if the following byte is a `\n`, it will
1136 /// then signify a match. (This enables us to delay a match by one byte,
1137 /// in order to account for the EOF sentinel byte.)
1158 // the current byte.
1207 // Reserve 1 byte for flags.
1331 /// Returns the next state given the current state si and current byte
1376 // matches are delayed by one byte, start states can never be match
1395 // by one byte. Given an empty string and an empty match, the match
1397 // sentinel byte.
1418 let is_word_last = at > 0 && Byte::byte(text[at - 1]).is_ascii_word();
1419 let is_word = at < text.len() && Byte::byte(text[at]).is_ascii_word();
1448 at < text.len() && Byte::byte(text[at]).is_ascii_word();
1449 let is_word = at > 0 && Byte::byte(text[at - 1]).is_ascii_word();
1488 let cls = self.byte_class(Byte::byte(b as u8));
1516 /// Returns the number of byte classes required to discriminate transitions
1521 // We add 1 to account for the special EOF byte.
1525 /// Given an input byte or the special EOF sentinel, return its
1526 /// corresponding byte class.
1576 /// inputs, a new state could be created for every byte of input. (This is
1603 /// The number of byte classes in the DFA. Used to index `states`.
1642 /// The number of byte classes corresponds to the stride. Every state will
1720 fn byte(b: u8) -> Self {
1802 /// Helper function for formatting a byte as a nice-to-read escaped string.