INNER CODE UNIT · Rust

read_attr_name

dontpanic92/OpenPAL3 · crosscom/ccidl-rs/src/lib.rs:615

    fn read_attr_name(&mut self) -> Result<String, String> {
        let start = self.pos;
        while let Some(ch) = self.peek_char() {
            if ch == '(' || ch == ',' || ch == ']' || ch.is_whitespace() {
                break;
            }
            self.pos += ch.len_utf8();
        }
        if start == self.pos {
            Err(format!("expected attribute name near byte {}", self.pos))
        } else {
            Ok(self.input[start..self.pos].trim().to_string())
        }
    }

    fn read_identifier(&mut self) -> Result<String, String> {
        let start = self.pos;
        while let Some(ch) = self.peek_char() {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…