Skip to content

Commit 929fca5

Browse files
committed
minore: improve consistency
1 parent f27cda6 commit 929fca5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

crates/syntax/src/tests/sourcegen_ast.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ use crate::tests::ast_src::{
1919

2020
#[test]
2121
fn sourcegen_ast() {
22-
let grammar = rust_grammar();
23-
let ast = lower(&grammar);
24-
22+
let syntax_kinds = generate_syntax_kinds(KINDS_SRC);
2523
let syntax_kinds_file =
2624
sourcegen::project_root().join("crates/parser/src/syntax_kind/generated.rs");
27-
let syntax_kinds = generate_syntax_kinds(KINDS_SRC);
2825
sourcegen::ensure_file_contents(syntax_kinds_file.as_path(), &syntax_kinds);
2926

27+
let grammar = rust_grammar();
28+
let ast = lower(&grammar);
29+
30+
let ast_tokens = generate_tokens(&ast);
3031
let ast_tokens_file =
3132
sourcegen::project_root().join("crates/syntax/src/ast/generated/tokens.rs");
32-
let contents = generate_tokens(&ast);
33-
sourcegen::ensure_file_contents(ast_tokens_file.as_path(), &contents);
33+
sourcegen::ensure_file_contents(ast_tokens_file.as_path(), &ast_tokens);
3434

35+
let ast_nodes = generate_nodes(KINDS_SRC, &ast);
3536
let ast_nodes_file = sourcegen::project_root().join("crates/syntax/src/ast/generated/nodes.rs");
36-
let contents = generate_nodes(KINDS_SRC, &ast);
37-
sourcegen::ensure_file_contents(ast_nodes_file.as_path(), &contents);
37+
sourcegen::ensure_file_contents(ast_nodes_file.as_path(), &ast_nodes);
3838
}
3939

4040
fn generate_tokens(grammar: &AstSrc) -> String {

0 commit comments

Comments
 (0)