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 4f2ea90 commit 5b99d56
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 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 All @@ -448,7 +442,7 @@ impl<'t, 'contents> Parser<'t, 'contents> {
.with_label(ReportLabel::new(self.current.span.clone()))
.into();
};

Ok(Type::Size(size))
},
TokenKind::Identifier => Ok(Type::Struct(self.current.text.to_string())),
Expand Down Expand Up @@ -608,6 +602,5 @@ impl<'t, 'contents> Parser<'t, 'contents> {
Ok(t)
}
})

}
}

0 comments on commit 5b99d56

Please sign in to comment.