Parse and infer tuple indices

This commit is contained in:
robojumper 2019-04-05 22:34:45 +02:00
parent 0372eca5b2
commit ca40ca93a5
13 changed files with 210 additions and 14 deletions

View file

@ -95,6 +95,7 @@ pub enum SyntaxErrorKind {
InvalidSuffix,
InvalidBlockAttr,
InvalidMatchInnerAttr,
InvalidTupleIndexFormat,
}
impl fmt::Display for SyntaxErrorKind {
@ -139,6 +140,9 @@ impl fmt::Display for SyntaxErrorKind {
InvalidMatchInnerAttr => {
write!(f, "Inner attributes are only allowed directly after the opening brace of the match expression")
}
InvalidTupleIndexFormat => {
write!(f, "Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix")
}
ParseError(msg) => write!(f, "{}", msg.0),
}
}