feat: parser improvements

- record creation with punning
- disambiguate if condition from record creation with punning
- split parser tests up into many smaller ones
This commit is contained in:
rvcas
2022-12-04 16:02:26 -05:00
committed by Lucas
parent 375499930a
commit 391849bf37
7 changed files with 1386 additions and 1064 deletions

View File

@@ -69,6 +69,7 @@ pub fn lexer() -> impl Parser<char, Vec<(Token, Span)>, Error = ParseError> {
"fn" => Token::Fn,
"if" => Token::If,
"else" => Token::Else,
"then" => Token::Then,
"is" => Token::Is,
"let" => Token::Let,
"opaque" => Token::Opaque,

View File

@@ -72,6 +72,7 @@ pub enum Token {
Trace,
Type,
When,
Then,
}
impl fmt::Display for Token {
@@ -145,6 +146,7 @@ impl fmt::Display for Token {
Token::Todo => "todo",
Token::Trace => "try",
Token::Type => "type",
Token::Then => "then",
};
write!(f, "\"{}\"", s)
}