mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Add expr, pat, ty and macro_stmts
This commit is contained in:
parent
3ff5440a50
commit
c0f19d7005
5 changed files with 156 additions and 15 deletions
|
@ -55,6 +55,21 @@ pub(crate) fn macro_items(p: &mut Parser) {
|
|||
m.complete(p, MACRO_ITEMS);
|
||||
}
|
||||
|
||||
pub(crate) fn macro_stmts(p: &mut Parser) {
|
||||
let m = p.start();
|
||||
|
||||
while !p.at(EOF) {
|
||||
if p.current() == SEMI {
|
||||
p.bump();
|
||||
continue;
|
||||
}
|
||||
|
||||
expressions::stmt(p, expressions::StmtWithSemi::Optional);
|
||||
}
|
||||
|
||||
m.complete(p, MACRO_STMTS);
|
||||
}
|
||||
|
||||
pub(crate) fn path(p: &mut Parser) {
|
||||
paths::type_path(p);
|
||||
}
|
||||
|
@ -72,6 +87,11 @@ pub(crate) fn pattern(p: &mut Parser) {
|
|||
}
|
||||
|
||||
pub(crate) fn stmt(p: &mut Parser, with_semi: bool) {
|
||||
let with_semi = match with_semi {
|
||||
true => expressions::StmtWithSemi::Yes,
|
||||
false => expressions::StmtWithSemi::No,
|
||||
};
|
||||
|
||||
expressions::stmt(p, with_semi)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue