mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Fix a bunch of bugs in parsing/formatting found by fuzzing
This commit is contained in:
parent
acd446f6bd
commit
3fee0d3e8f
43 changed files with 593 additions and 70 deletions
|
@ -264,6 +264,7 @@ pub enum BadIdent {
|
|||
WeirdDotQualified(Position),
|
||||
StrayDot(Position),
|
||||
BadOpaqueRef(Position),
|
||||
QualifiedTupleAccessor(Position),
|
||||
}
|
||||
|
||||
fn is_alnum(ch: char) -> bool {
|
||||
|
@ -500,6 +501,13 @@ fn chomp_identifier_chain<'a>(
|
|||
|
||||
match chomp_access_chain(&buffer[chomped..], &mut parts) {
|
||||
Ok(width) => {
|
||||
if matches!(parts[0], Accessor::TupleIndex(_)) && first_is_uppercase {
|
||||
return Err((
|
||||
chomped as u32,
|
||||
BadIdent::QualifiedTupleAccessor(pos.bump_column(chomped as u32)),
|
||||
));
|
||||
}
|
||||
|
||||
chomped += width as usize;
|
||||
|
||||
let ident = Ident::Access {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue