Implement parser & formater for 'TraceIfFalse'
Interestingly enough, chumsky seems to fail when given a 'choice' with more than 25 elements. That's why this commit groups together some of the choices as another nested 'choice'.
This commit is contained in:
@@ -35,10 +35,13 @@ pub fn lexer() -> impl Parser<char, Vec<(Token, Span)>, Error = ParseError> {
|
||||
just('.').to(Token::Dot),
|
||||
just("!=").to(Token::NotEqual),
|
||||
just('!').to(Token::Bang),
|
||||
just("<=").to(Token::LessEqual),
|
||||
just('<').to(Token::Less),
|
||||
just(">=").to(Token::GreaterEqual),
|
||||
just('>').to(Token::Greater),
|
||||
just('?').to(Token::Question),
|
||||
choice((
|
||||
just("<=").to(Token::LessEqual),
|
||||
just('<').to(Token::Less),
|
||||
just(">=").to(Token::GreaterEqual),
|
||||
just('>').to(Token::Greater),
|
||||
)),
|
||||
just('+').to(Token::Plus),
|
||||
just("->").to(Token::RArrow),
|
||||
just('-').to(Token::Minus),
|
||||
|
||||
@@ -39,8 +39,9 @@ pub enum Token {
|
||||
// Other Punctuation
|
||||
Colon,
|
||||
Comma,
|
||||
Hash, // '#'
|
||||
Bang, // '!'
|
||||
Hash, // '#'
|
||||
Bang, // '!'
|
||||
Question, // '?'
|
||||
Equal,
|
||||
EqualEqual, // '=='
|
||||
NotEqual, // '!='
|
||||
@@ -125,6 +126,7 @@ impl fmt::Display for Token {
|
||||
Token::Hash => "#",
|
||||
Token::Bang => "!",
|
||||
Token::Equal => "=",
|
||||
Token::Question => "?",
|
||||
Token::EqualEqual => "==",
|
||||
Token::NotEqual => "!=",
|
||||
Token::Vbar => "|",
|
||||
|
||||
Reference in New Issue
Block a user