Skip to content

Commit

Permalink
fmt: whitespace
Browse files Browse the repository at this point in the history
Signed-off-by: fami-fish <[email protected]>
  • Loading branch information
fami-fish committed Aug 1, 2024
1 parent 41a7549 commit 5b9c470
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,7 @@ impl<'t, 'contents> Parser<'t, 'contents> {
TokenKind::Identifier => Ok(()),
TokenKind::DecimalIntLiteral => ReportKind::SyntaxError
.new("Expected register starting with r")
.with_note(format!(
"HINT: You forgot the r prefix. Do: r{}",
self.current.text
))
.with_note(format!("HINT: You forgot the r prefix. Do: r{}", self.current.text))
.with_label(ReportLabel::new(self.current.span.clone()))
.into(),
_ => ReportKind::UnexpectedToken
Expand All @@ -412,9 +409,7 @@ impl<'t, 'contents> Parser<'t, 'contents> {
IntErrorKind::Empty => ReportKind::SyntaxError
.new("Expected register identifier after r prefix")
.with_label(ReportLabel::new(self.current.span.clone()))
.with_note(
"HINT: Registers follow the format r<ident>. e.g r8 r32",
),
.with_note("HINT: Registers follow the format r<ident>. e.g r8 r32"),
IntErrorKind::InvalidDigit => {
let mut span = self.current.span.clone();
span.start_index += 1;
Expand All @@ -423,16 +418,15 @@ impl<'t, 'contents> Parser<'t, 'contents> {
ReportKind::SyntaxError
.new("Register number contains an invalid digit")
.with_label(ReportLabel::new(self.current.span.clone()))
.with_note(
"HINT: Registers follow the format r<ident>. e.g r8 r32",
)
.with_note("HINT: Registers follow the format r<ident>. e.g r8 r32")
},
_ => ReportKind::SyntaxError
.new("Register identifier intager overflows")
.with_label(ReportLabel::new(self.current.span.clone()))
.with_note("HINT: You dont have this many registers. Trust me"),
}.into(),
Ok(i) => Ok(Type::Register { inner: inner.map(|t| Box::new(t)), ident: i })
}
.into(),
Ok(i) => Ok(Type::Register { inner: inner.map(|t| Box::new(t)), ident: i }),
}
}

Expand Down

0 comments on commit 5b9c470

Please sign in to comment.