mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-14 17:07:26 +00:00
minore: improve consistency
This commit is contained in:
parent
f27cda6865
commit
929fca5adc
1 changed files with 9 additions and 9 deletions
|
@ -19,22 +19,22 @@ use crate::tests::ast_src::{
|
|||
|
||||
#[test]
|
||||
fn sourcegen_ast() {
|
||||
let syntax_kinds = generate_syntax_kinds(KINDS_SRC);
|
||||
let syntax_kinds_file =
|
||||
sourcegen::project_root().join("crates/parser/src/syntax_kind/generated.rs");
|
||||
sourcegen::ensure_file_contents(syntax_kinds_file.as_path(), &syntax_kinds);
|
||||
|
||||
let grammar = rust_grammar();
|
||||
let ast = lower(&grammar);
|
||||
|
||||
let syntax_kinds_file =
|
||||
sourcegen::project_root().join("crates/parser/src/syntax_kind/generated.rs");
|
||||
let syntax_kinds = generate_syntax_kinds(KINDS_SRC);
|
||||
sourcegen::ensure_file_contents(syntax_kinds_file.as_path(), &syntax_kinds);
|
||||
|
||||
let ast_tokens = generate_tokens(&ast);
|
||||
let ast_tokens_file =
|
||||
sourcegen::project_root().join("crates/syntax/src/ast/generated/tokens.rs");
|
||||
let contents = generate_tokens(&ast);
|
||||
sourcegen::ensure_file_contents(ast_tokens_file.as_path(), &contents);
|
||||
sourcegen::ensure_file_contents(ast_tokens_file.as_path(), &ast_tokens);
|
||||
|
||||
let ast_nodes = generate_nodes(KINDS_SRC, &ast);
|
||||
let ast_nodes_file = sourcegen::project_root().join("crates/syntax/src/ast/generated/nodes.rs");
|
||||
let contents = generate_nodes(KINDS_SRC, &ast);
|
||||
sourcegen::ensure_file_contents(ast_nodes_file.as_path(), &contents);
|
||||
sourcegen::ensure_file_contents(ast_nodes_file.as_path(), &ast_nodes);
|
||||
}
|
||||
|
||||
fn generate_tokens(grammar: &AstSrc) -> String {
|
||||
|
|
Loading…
Reference in a new issue