feat: initial support for safe_kw in extern blocks

This commit is contained in:
roife 2024-10-20 16:45:38 +08:00
parent 687b72c36a
commit 9f1e450c4f
12 changed files with 264 additions and 9 deletions

View file

@ -135,6 +135,11 @@ pub(super) fn opt_item(p: &mut Parser<'_>, m: Marker) -> Result<(), Marker> {
has_mods = true;
}
if p.at(T![safe]) {
p.eat(T![safe]);
has_mods = true;
}
if p.at(T![extern]) {
has_extern = true;
has_mods = true;
@ -189,6 +194,7 @@ pub(super) fn opt_item(p: &mut Parser<'_>, m: Marker) -> Result<(), Marker> {
T![fn] => fn_(p, m),
T![const] if p.nth(1) != T!['{'] => consts::konst(p, m),
T![static] if matches!(p.nth(1), IDENT | T![_] | T![mut]) => consts::static_(p, m),
T![trait] => traits::trait_(p, m),
T![impl] => traits::impl_(p, m),

File diff suppressed because one or more lines are too long