diff options
author | Aleksey Kladov <[email protected]> | 2020-04-09 15:25:06 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-09 15:25:06 +0100 |
commit | 59b6b2278b7f7d2089b5caf6fcfd57528d9aafd0 (patch) | |
tree | 860185a74b977f8583f0d5a9183975d87676b022 | |
parent | d61932ef7e74f3d9f7863c33c6647c2c52538ed5 (diff) |
Start ast/generated/tokens
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 1 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/generated/tokens.rs | 1 | ||||
-rw-r--r-- | xtask/src/codegen.rs | 1 | ||||
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 10 |
4 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 6216641d8..1e0ba3f71 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -1,3 +1,4 @@ | |||
1 | //! This file is actually hand-written, but the submodules are indeed generated. | 1 | //! This file is actually hand-written, but the submodules are indeed generated. |
2 | 2 | ||
3 | pub(super) mod nodes; | 3 | pub(super) mod nodes; |
4 | pub(super) mod tokens; | ||
diff --git a/crates/ra_syntax/src/ast/generated/tokens.rs b/crates/ra_syntax/src/ast/generated/tokens.rs new file mode 100644 index 000000000..4494af1be --- /dev/null +++ b/crates/ra_syntax/src/ast/generated/tokens.rs | |||
@@ -0,0 +1 @@ | |||
//! Generated file, do not edit by hand, see `xtask/src/codegen` \ No newline at end of file | |||
diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index e6ba2009c..678b40133 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs | |||
@@ -24,6 +24,7 @@ const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/err | |||
24 | 24 | ||
25 | const SYNTAX_KINDS: &str = "crates/ra_parser/src/syntax_kind/generated.rs"; | 25 | const SYNTAX_KINDS: &str = "crates/ra_parser/src/syntax_kind/generated.rs"; |
26 | const AST_NODES: &str = "crates/ra_syntax/src/ast/generated/nodes.rs"; | 26 | const AST_NODES: &str = "crates/ra_syntax/src/ast/generated/nodes.rs"; |
27 | const AST_TOKENS: &str = "crates/ra_syntax/src/ast/generated/tokens.rs"; | ||
27 | 28 | ||
28 | const ASSISTS_DIR: &str = "crates/ra_assists/src/handlers"; | 29 | const ASSISTS_DIR: &str = "crates/ra_assists/src/handlers"; |
29 | const ASSISTS_TESTS: &str = "crates/ra_assists/src/doc_tests/generated.rs"; | 30 | const ASSISTS_TESTS: &str = "crates/ra_assists/src/doc_tests/generated.rs"; |
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index c2734d638..75bcd1973 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -22,9 +22,13 @@ pub fn generate_syntax(mode: Mode) -> Result<()> { | |||
22 | let syntax_kinds = generate_syntax_kinds(KINDS_SRC)?; | 22 | let syntax_kinds = generate_syntax_kinds(KINDS_SRC)?; |
23 | update(syntax_kinds_file.as_path(), &syntax_kinds, mode)?; | 23 | update(syntax_kinds_file.as_path(), &syntax_kinds, mode)?; |
24 | 24 | ||
25 | let ast_file = project_root().join(codegen::AST_NODES); | 25 | let ast_nodes_file = project_root().join(codegen::AST_NODES); |
26 | let ast = generate_ast(KINDS_SRC, AST_SRC)?; | 26 | let contents = generate_ast(KINDS_SRC, AST_SRC)?; |
27 | update(ast_file.as_path(), &ast, mode)?; | 27 | update(ast_nodes_file.as_path(), &contents, mode)?; |
28 | |||
29 | let ast_tokens_file = project_root().join(codegen::AST_TOKENS); | ||
30 | let contents = "//! Generated file, do not edit by hand, see `xtask/src/codegen`"; | ||
31 | update(ast_tokens_file.as_path(), &contents, mode)?; | ||
28 | 32 | ||
29 | Ok(()) | 33 | Ok(()) |
30 | } | 34 | } |