Return early when encountering ! in an ident

This commit is contained in:
Agus Zubiaga 2024-10-28 09:06:48 -03:00
parent a0f4b38ee9
commit 1a3d8cef78
No known key found for this signature in database

View file

@ -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;