mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Return early when encountering !
in an ident
This commit is contained in:
parent
a0f4b38ee9
commit
1a3d8cef78
1 changed files with 8 additions and 1 deletions
|
@ -490,7 +490,14 @@ fn chomp_identifier_chain<'a>(
|
|||
chomped += width;
|
||||
} else if ch == '!' && !first_is_uppercase {
|
||||
chomped += width;
|
||||
break;
|
||||
|
||||
let value = unsafe { std::str::from_utf8_unchecked(&buffer[..chomped]) };
|
||||
let ident = Ident::Access {
|
||||
module_name: "",
|
||||
parts: arena.alloc([Accessor::RecordField(value)]),
|
||||
};
|
||||
|
||||
return Ok((chomped as u32, ident));
|
||||
} else {
|
||||
// we're done
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue