mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Don't bail on parse errors in macro input for builtin expansion
This commit is contained in:
parent
b02027d4fe
commit
e7e87fc69d
2 changed files with 18 additions and 4 deletions
|
@ -90,7 +90,7 @@ pub fn parse_to_token_tree(text: &str) -> Option<(tt::Subtree, TokenMap)> {
|
|||
Some((subtree, conv.id_alloc.map))
|
||||
}
|
||||
|
||||
/// Split token tree with seperate expr: $($e:expr)SEP*
|
||||
/// Split token tree with separate expr: $($e:expr)SEP*
|
||||
pub fn parse_exprs_with_sep(tt: &tt::Subtree, sep: char) -> Vec<tt::Subtree> {
|
||||
if tt.token_trees.is_empty() {
|
||||
return Vec::new();
|
||||
|
@ -101,9 +101,6 @@ pub fn parse_exprs_with_sep(tt: &tt::Subtree, sep: char) -> Vec<tt::Subtree> {
|
|||
|
||||
while iter.peek_n(0).is_some() {
|
||||
let expanded = iter.expect_fragment(ParserEntryPoint::Expr);
|
||||
if expanded.err.is_some() {
|
||||
break;
|
||||
}
|
||||
|
||||
res.push(match expanded.value {
|
||||
None => break,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue