mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +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;
|
chomped += width;
|
||||||
} else if ch == '!' && !first_is_uppercase {
|
} else if ch == '!' && !first_is_uppercase {
|
||||||
chomped += width;
|
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 {
|
} else {
|
||||||
// we're done
|
// we're done
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue