chore: format

This commit is contained in:
Ryan Chandler 2022-09-14 12:01:30 +01:00
parent 2b7d41812f
commit 16af78d56d
No known key found for this signature in database
GPG Key ID: F113BCADDB3B0CCA
2 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@ use trunk_lexer::Lexer;
use trunk_parser::Parser;
fn main() {
let file = std::env::args().nth(1).unwrap();
let file = std::env::args().nth(1).unwrap();
let contents = std::fs::read_to_string(&file).unwrap();
println!("> Parsing {}", file);
@ -14,4 +14,4 @@ fn main() {
let ast = parser.parse(tokens).unwrap();
dbg!(ast);
}
}

View File

@ -8,7 +8,7 @@ use crate::{
use std::{fmt::Display, vec::IntoIter};
use trunk_lexer::{Span, Token, TokenKind};
use self::precedence::{Precedence, Associativity};
use self::precedence::{Associativity, Precedence};
type ParseResult<T> = Result<T, ParseError>;
@ -1835,11 +1835,13 @@ impl Parser {
break;
}
if rpred == precedence && matches!(rpred.associativity(), Some(Associativity::Left)) {
if rpred == precedence && matches!(rpred.associativity(), Some(Associativity::Left))
{
break;
}
if rpred == precedence && matches!(rpred.associativity(), Some(Associativity::Non)) {
if rpred == precedence && matches!(rpred.associativity(), Some(Associativity::Non))
{
return Err(ParseError::UnexpectedToken(kind.to_string(), span));
}
@ -2221,8 +2223,8 @@ mod tests {
},
Catch, Expression, Identifier, Param, Statement, Type,
};
use pretty_assertions::assert_eq;
use trunk_lexer::Lexer;
use pretty_assertions::{assert_eq};
macro_rules! function {
($name:literal, $params:expr, $body:expr) => {