Lines Matching refs:at
21 /// Returns true iff this position is at the beginning of the input.
31 /// Returns the character at this position.
39 /// Returns the byte at this position.
44 /// Returns the UTF-8 width of the character at this position.
49 /// Returns whether the UTF-8 width of the character at this position
68 /// Return an encoding of the position at byte offset `i`.
69 fn at(&self, i: usize) -> InputAt;
71 /// Return the Unicode character occurring next to `at`.
74 fn next_char(&self, at: InputAt) -> Char;
76 /// Return the Unicode character occurring previous to `at`.
79 fn previous_char(&self, at: InputAt) -> Char;
81 /// Return true if the given empty width instruction matches at the
83 fn is_empty_match(&self, at: InputAt, empty: &InstEmptyLook) -> bool;
89 at: InputAt,
105 fn at(&self, i: usize) -> InputAt {
106 (**self).at(i)
109 fn next_char(&self, at: InputAt) -> Char {
110 (**self).next_char(at)
113 fn previous_char(&self, at: InputAt) -> Char {
114 (**self).previous_char(at)
117 fn is_empty_match(&self, at: InputAt, empty: &InstEmptyLook) -> bool {
118 (**self).is_empty_match(at, empty)
124 at: InputAt,
126 (**self).prefix_at(prefixes, at)
158 fn at(&self, i: usize) -> InputAt {
167 fn next_char(&self, at: InputAt) -> Char {
168 at.char()
171 fn previous_char(&self, at: InputAt) -> Char {
172 decode_last_utf8(&self[..at.pos()]).map(|(c, _)| c).into()
175 fn is_empty_match(&self, at: InputAt, empty: &InstEmptyLook) -> bool {
179 let c = self.previous_char(at);
180 at.pos() == 0 || c == '\n'
183 let c = self.next_char(at);
184 at.pos() == self.len() || c == '\n'
186 StartText => at.pos() == 0,
187 EndText => at.pos() == self.len(),
189 let (c1, c2) = (self.previous_char(at), self.next_char(at));
193 let (c1, c2) = (self.previous_char(at), self.next_char(at));
197 let (c1, c2) = (self.previous_char(at), self.next_char(at));
201 let (c1, c2) = (self.previous_char(at), self.next_char(at));
210 at: InputAt,
212 prefixes.find(&self[at.pos()..]).map(|(s, _)| self.at(at.pos() + s))
247 fn at(&self, i: usize) -> InputAt {
260 fn next_char(&self, at: InputAt) -> Char {
261 decode_utf8(&self[at.pos()..]).map(|(c, _)| c).into()
264 fn previous_char(&self, at: InputAt) -> Char {
265 decode_last_utf8(&self[..at.pos()]).map(|(c, _)| c).into()
268 fn is_empty_match(&self, at: InputAt, empty: &InstEmptyLook) -> bool {
272 let c = self.previous_char(at);
273 at.pos() == 0 || c == '\n'
276 let c = self.next_char(at);
277 at.pos() == self.len() || c == '\n'
279 StartText => at.pos() == 0,
280 EndText => at.pos() == self.len(),
282 let (c1, c2) = (self.previous_char(at), self.next_char(at));
286 let (c1, c2) = (self.previous_char(at), self.next_char(at));
290 let (c1, c2) = (self.previous_char(at), self.next_char(at));
293 // boundaries at invalid UTF-8.
294 if c1.is_none() && !at.is_start() {
297 if c2.is_none() && !at.is_end() {
304 let (c1, c2) = (self.previous_char(at), self.next_char(at));
307 // boundaries at invalid UTF-8.
308 if c1.is_none() && !at.is_start() {
311 if c2.is_none() && !at.is_end() {
323 at: InputAt,
325 prefixes.find(&self[at.pos()..]).map(|(s, _)| self.at(at.pos() + s))