style(tazjin/rlox): Set max_width=80
Change-Id: Ib64831c0b97c94fdfbdbae64f4dfccc86879ef73 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2554 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
ebc987f4aa
commit
75750ba683
7 changed files with 153 additions and 50 deletions
|
|
@ -213,7 +213,9 @@ impl Parser {
|
|||
if params.len() >= 255 {
|
||||
return Err(Error {
|
||||
line: self.peek().line,
|
||||
kind: ErrorKind::InternalError("255 parameter limit exceeded.".into()),
|
||||
kind: ErrorKind::InternalError(
|
||||
"255 parameter limit exceeded.".into(),
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -427,7 +429,10 @@ impl Parser {
|
|||
|
||||
return Err(Error {
|
||||
line: equals.line,
|
||||
kind: ErrorKind::InvalidAssignmentTarget(format!("{:?}", equals)),
|
||||
kind: ErrorKind::InvalidAssignmentTarget(format!(
|
||||
"{:?}",
|
||||
equals
|
||||
)),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -490,7 +495,9 @@ impl Parser {
|
|||
}
|
||||
|
||||
fn unary(&mut self) -> ExprResult {
|
||||
if self.match_token(&TokenKind::Bang) || self.match_token(&TokenKind::Minus) {
|
||||
if self.match_token(&TokenKind::Bang)
|
||||
|| self.match_token(&TokenKind::Minus)
|
||||
{
|
||||
return Ok(Expr::Unary(Unary {
|
||||
operator: self.previous().clone(),
|
||||
right: Box::new(self.unary()?),
|
||||
|
|
@ -550,7 +557,10 @@ impl Parser {
|
|||
|
||||
TokenKind::LeftParen => {
|
||||
let expr = self.expression()?;
|
||||
self.consume(&TokenKind::RightParen, ErrorKind::UnmatchedParens)?;
|
||||
self.consume(
|
||||
&TokenKind::RightParen,
|
||||
ErrorKind::UnmatchedParens,
|
||||
)?;
|
||||
return Ok(Expr::Grouping(Grouping(Box::new(expr))));
|
||||
}
|
||||
|
||||
|
|
@ -622,7 +632,11 @@ impl Parser {
|
|||
&self.tokens[self.current - 1]
|
||||
}
|
||||
|
||||
fn consume(&mut self, kind: &TokenKind, err: ErrorKind) -> Result<Token, Error> {
|
||||
fn consume(
|
||||
&mut self,
|
||||
kind: &TokenKind,
|
||||
err: ErrorKind,
|
||||
) -> Result<Token, Error> {
|
||||
if self.check_token(kind) {
|
||||
return Ok(self.advance());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue