mirror of
https://github.com/danog/parser.git
synced 2024-11-30 04:29:13 +01:00
chore: format
This commit is contained in:
parent
2b7d41812f
commit
16af78d56d
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user