Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ This document will **NOT** be updated for you, but feel free to update it whenev
---

**Chloe** ([@akiramusic000](https://github.com/akiramusic000)) - Lead Developer
**Yichi Zhang** ([@YichiZhang0613](https://github.com/YichiZhang0613))
4 changes: 2 additions & 2 deletions tackc_lib/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,8 +1079,8 @@ impl<'src, 'a> Parser<'src, 'a> {
if !mode.normal()
|| self
.peek()
.filter(|t| t.kind == TokenKind::LBrace)
.is_none()
.as_ref()
.is_none_or(|t| t.kind != TokenKind::LBrace)
{
return self.global_ident(recursion);
}
Expand Down
12 changes: 6 additions & 6 deletions tackc_lib/src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ impl Span {
/// This function will panic if the input string's length is greater than [`SpanValue::MAX`].
pub fn eof(string: &str) -> Self {
assert!(
string.len() < SpanValue::MAX as usize,
"Length of `Span::eof` input must be less than `SpanValue::MAX!`"
string.len() <= SpanValue::MAX as usize,
"Length of `Span::eof` input must be less than or equal to `SpanValue::MAX!`"
);

Self {
// Since `string.len() < SpanValue::MAX`, try_into() will return `Ok`.
// Since `string.len() <= SpanValue::MAX`, try_into() will return `Ok`.
start: string.len().try_into().expect_unreachable(), // CHECKED(Chloe)
end: string.len().try_into().expect_unreachable(), // CHECKED(Chloe)
}
Expand All @@ -57,13 +57,13 @@ impl Span {
/// This function will panic if the input string's length is greater than [`SpanValue::MAX`].
pub fn full(string: &str) -> Self {
assert!(
string.len() < SpanValue::MAX as usize,
"Length of `Span::full` input must be less than `SpanValue::MAX!`"
string.len() <= SpanValue::MAX as usize,
"Length of `Span::full` input must be less than or equal to `SpanValue::MAX!`"
);

Self {
start: 0,
// Since `string.len() < SpanValue::MAX`, try_into() will return `Ok`.
// Since `string.len() <= SpanValue::MAX`, try_into() will return `Ok`.
end: string.len().try_into().expect_unreachable(), // CHECKED(Chloe)
}
}
Expand Down