mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
reformat the world
This commit is contained in:
parent
5cb1d41a30
commit
12e3b4c70b
129 changed files with 727 additions and 2509 deletions
|
@ -137,18 +137,12 @@ impl_froms!(TokenTree: Leaf, Subtree);
|
|||
"#;
|
||||
|
||||
let source_file = ast::SourceFile::parse(macro_definition);
|
||||
let macro_definition = source_file
|
||||
.syntax()
|
||||
.descendants()
|
||||
.find_map(ast::MacroCall::cast)
|
||||
.unwrap();
|
||||
let macro_definition =
|
||||
source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap();
|
||||
|
||||
let source_file = ast::SourceFile::parse(macro_invocation);
|
||||
let macro_invocation = source_file
|
||||
.syntax()
|
||||
.descendants()
|
||||
.find_map(ast::MacroCall::cast)
|
||||
.unwrap();
|
||||
let macro_invocation =
|
||||
source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap();
|
||||
|
||||
let definition_tt = ast_to_token_tree(macro_definition.token_tree().unwrap()).unwrap();
|
||||
let invocation_tt = ast_to_token_tree(macro_invocation.token_tree().unwrap()).unwrap();
|
||||
|
@ -163,11 +157,8 @@ impl_froms!(TokenTree: Leaf, Subtree);
|
|||
|
||||
fn create_rules(macro_definition: &str) -> MacroRules {
|
||||
let source_file = ast::SourceFile::parse(macro_definition);
|
||||
let macro_definition = source_file
|
||||
.syntax()
|
||||
.descendants()
|
||||
.find_map(ast::MacroCall::cast)
|
||||
.unwrap();
|
||||
let macro_definition =
|
||||
source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap();
|
||||
|
||||
let definition_tt = ast_to_token_tree(macro_definition.token_tree().unwrap()).unwrap();
|
||||
crate::MacroRules::parse(&definition_tt).unwrap()
|
||||
|
@ -175,11 +166,8 @@ impl_froms!(TokenTree: Leaf, Subtree);
|
|||
|
||||
fn assert_expansion(rules: &MacroRules, invocation: &str, expansion: &str) {
|
||||
let source_file = ast::SourceFile::parse(invocation);
|
||||
let macro_invocation = source_file
|
||||
.syntax()
|
||||
.descendants()
|
||||
.find_map(ast::MacroCall::cast)
|
||||
.unwrap();
|
||||
let macro_invocation =
|
||||
source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap();
|
||||
|
||||
let invocation_tt = ast_to_token_tree(macro_invocation.token_tree().unwrap()).unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue