Properly handle char types.

This commit is contained in:
Stephen Chung
2020-03-01 13:30:22 +08:00
parent 5f135353c0
commit e93fd7d3fe
4 changed files with 401 additions and 198 deletions

View File

@@ -54,6 +54,8 @@ pub enum ParseErrorType {
FnMissingParams,
}
type PERR = ParseErrorType;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub struct Position {
line: usize,
@@ -77,13 +79,11 @@ impl Position {
}
}
type PERR = ParseErrorType;
#[derive(Debug, PartialEq, Clone)]
pub struct ParseError(ParseErrorType, Position);
pub struct ParseError(PERR, Position);
impl ParseError {
pub fn error_type(&self) -> &ParseErrorType {
pub fn error_type(&self) -> &PERR {
&self.0
}
pub fn line(&self) -> usize {