mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
move expr
This commit is contained in:
parent
04ae18de29
commit
c5d8a9b341
3 changed files with 10 additions and 1 deletions
|
@ -691,7 +691,11 @@ fn match_leaf(lhs: &tt::Leaf, src: &mut TtIter) -> Result<(), ExpandError> {
|
||||||
fn match_meta_var(kind: &str, input: &mut TtIter) -> ExpandResult<Option<Fragment>> {
|
fn match_meta_var(kind: &str, input: &mut TtIter) -> ExpandResult<Option<Fragment>> {
|
||||||
let fragment = match kind {
|
let fragment = match kind {
|
||||||
"path" => ParserEntryPoint::Path,
|
"path" => ParserEntryPoint::Path,
|
||||||
"expr" => ParserEntryPoint::Expr,
|
"expr" => {
|
||||||
|
return input
|
||||||
|
.expect_fragment2(parser::PrefixEntryPoint::Expr)
|
||||||
|
.map(|tt| tt.map(Fragment::Expr));
|
||||||
|
}
|
||||||
"ty" => {
|
"ty" => {
|
||||||
return input
|
return input
|
||||||
.expect_fragment2(parser::PrefixEntryPoint::Ty)
|
.expect_fragment2(parser::PrefixEntryPoint::Ty)
|
||||||
|
|
|
@ -69,6 +69,9 @@ pub(crate) mod entry {
|
||||||
pub(crate) fn ty(p: &mut Parser) {
|
pub(crate) fn ty(p: &mut Parser) {
|
||||||
types::type_(p);
|
types::type_(p);
|
||||||
}
|
}
|
||||||
|
pub(crate) fn expr(p: &mut Parser) {
|
||||||
|
let _ = expressions::expr(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ pub enum PrefixEntryPoint {
|
||||||
Stmt,
|
Stmt,
|
||||||
Pat,
|
Pat,
|
||||||
Ty,
|
Ty,
|
||||||
|
Expr,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PrefixEntryPoint {
|
impl PrefixEntryPoint {
|
||||||
|
@ -67,6 +68,7 @@ impl PrefixEntryPoint {
|
||||||
PrefixEntryPoint::Stmt => grammar::entry::prefix::stmt,
|
PrefixEntryPoint::Stmt => grammar::entry::prefix::stmt,
|
||||||
PrefixEntryPoint::Pat => grammar::entry::prefix::pat,
|
PrefixEntryPoint::Pat => grammar::entry::prefix::pat,
|
||||||
PrefixEntryPoint::Ty => grammar::entry::prefix::ty,
|
PrefixEntryPoint::Ty => grammar::entry::prefix::ty,
|
||||||
|
PrefixEntryPoint::Expr => grammar::entry::prefix::expr,
|
||||||
};
|
};
|
||||||
let mut p = parser::Parser::new(input);
|
let mut p = parser::Parser::new(input);
|
||||||
entry_point(&mut p);
|
entry_point(&mut p);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue