'\'' | '\n' | '\r' | '\t' | '\u{0b}' | '\u{0c}' | '\u{08}' | '\u{07}' | '"' | '\\' => {
c.to_string()
}
- '\u{0}'..='\u{1f}' => format!("\\x{:x}", c as u32), // print all other control characters in hex.
+ '\u{0}'..='\u{1f}' => format!("\\x{:x}\\", c as u32), // print all other control characters in hex.
_ => c.to_string(),
- /*
- '\u{a0}'..='\u{d6}' => c.to_string(),
- '\u{d8}'..='\u{f6}' => c.to_string(),
- '\u{f8}'..='\u{74f}' => c.to_string(),
- '\x20'..='\x7e' => c.to_string(),
- _ => format!("\\x{:x}\\", c as u32),
- */
}
}
if hexadecimal_digit_char!(c) {
self.escape_sequence_to_char(|c| hexadecimal_digit_char!(c), 16)
} else {
- Err(ParserError::UnexpectedChar(c, self.line_num, self.col_num))
+ Err(ParserError::IncompleteReduction(self.line_num, self.col_num))
}
}
},
)
} else {
- // on failure, restore the token characters and backslash.
- // self.reader.put_back_all(token.chars().map(Ok));
- // self.reader.put_back(Ok('\\'));
-
- Err(ParserError::UnexpectedChar(c, self.line_num, self.col_num))
+ Err(ParserError::IncompleteReduction(self.line_num, self.col_num))
}
}
type SubtermDeque = VecDeque<(usize, usize)>;
-// pub(crate) type PrologStream = ParsingStream<Stream>;
-
impl MachineState {
pub(crate) fn devour_whitespace(
&mut self,