input.rs
SHA-2567d65fe2ebb7d84e634657fa121d7b6a7aca684961d1562d4b664dc84c62da36e
Malecule∅
Evidence
1// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LIC …
8:59… ibuted
9// except according to those terms.
10
11use std::char;
12use std::cmp::Ordering;
13use std::fmt;
14use std::ops;
15use std::u32;
16
17use syntax;
18
19use literals::LiteralSearcher;
20use prog::InstEmptyLook;
21use utf8::{decode_utf8, decode_last_utf8};
22
23/// Represents a location in the input.
24#[derive(Clone, Copy, Debug)]
25pub struct InputAt {
26 pos …
95:51… InstEmptyLook) -> bool;
96
97 /// Scan the input for a matching prefix.
98 fn prefix_at(
99 &self,
100 prefixes: &LiteralSearcher,
101 …
176:40… t, empty: &InstEmptyLook) -> bool {
177 use prog::EmptyLook::*;
178 match empty.look {
179 StartLine => {
180 let c = self.previous_ch …
254:3… c: None.into(),
255 byte: self.get(i).cloned(),
256 len: 1,
257 }
258 }
259
260 fn next_char(&self, at: InputAt) -> Char { …