mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Start ast/generated/tokens
This commit is contained in:
parent
d61932ef7e
commit
59b6b2278b
4 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
//! This file is actually hand-written, but the submodules are indeed generated.
|
||||
|
||||
pub(super) mod nodes;
|
||||
pub(super) mod tokens;
|
||||
|
|
1
crates/ra_syntax/src/ast/generated/tokens.rs
Normal file
1
crates/ra_syntax/src/ast/generated/tokens.rs
Normal file
|
@ -0,0 +1 @@
|
|||
//! Generated file, do not edit by hand, see `xtask/src/codegen`
|
|
@ -24,6 +24,7 @@ const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/err
|
|||
|
||||
const SYNTAX_KINDS: &str = "crates/ra_parser/src/syntax_kind/generated.rs";
|
||||
const AST_NODES: &str = "crates/ra_syntax/src/ast/generated/nodes.rs";
|
||||
const AST_TOKENS: &str = "crates/ra_syntax/src/ast/generated/tokens.rs";
|
||||
|
||||
const ASSISTS_DIR: &str = "crates/ra_assists/src/handlers";
|
||||
const ASSISTS_TESTS: &str = "crates/ra_assists/src/doc_tests/generated.rs";
|
||||
|
|
|
@ -22,9 +22,13 @@ pub fn generate_syntax(mode: Mode) -> Result<()> {
|
|||
let syntax_kinds = generate_syntax_kinds(KINDS_SRC)?;
|
||||
update(syntax_kinds_file.as_path(), &syntax_kinds, mode)?;
|
||||
|
||||
let ast_file = project_root().join(codegen::AST_NODES);
|
||||
let ast = generate_ast(KINDS_SRC, AST_SRC)?;
|
||||
update(ast_file.as_path(), &ast, mode)?;
|
||||
let ast_nodes_file = project_root().join(codegen::AST_NODES);
|
||||
let contents = generate_ast(KINDS_SRC, AST_SRC)?;
|
||||
update(ast_nodes_file.as_path(), &contents, mode)?;
|
||||
|
||||
let ast_tokens_file = project_root().join(codegen::AST_TOKENS);
|
||||
let contents = "//! Generated file, do not edit by hand, see `xtask/src/codegen`";
|
||||
update(ast_tokens_file.as_path(), &contents, mode)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue