diff options
Diffstat (limited to 'crates/tools/src/main.rs')
-rw-r--r-- | crates/tools/src/main.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/tools/src/main.rs b/crates/tools/src/main.rs index aa6d964e6..549892bc6 100644 --- a/crates/tools/src/main.rs +++ b/crates/tools/src/main.rs | |||
@@ -11,15 +11,10 @@ use std::{ | |||
11 | path::{Path, PathBuf}, | 11 | path::{Path, PathBuf}, |
12 | process::Command, | 12 | process::Command, |
13 | }; | 13 | }; |
14 | use tools::{Test, collect_tests, render_template, update, Result}; | 14 | use tools::{AST, AST_TEMPLATE, Result, SYNTAX_KINDS, SYNTAX_KINDS_TEMPLATE, Test, collect_tests, render_template, update, project_root}; |
15 | 15 | ||
16 | const GRAMMAR_DIR: &str = "./crates/ra_syntax/src/grammar"; | 16 | const GRAMMAR_DIR: &str = "./crates/ra_syntax/src/grammar"; |
17 | const INLINE_TESTS_DIR: &str = "./crates/ra_syntax/tests/data/parser/inline"; | 17 | const INLINE_TESTS_DIR: &str = "./crates/ra_syntax/tests/data/parser/inline"; |
18 | const GRAMMAR: &str = "./crates/ra_syntax/src/grammar.ron"; | ||
19 | const SYNTAX_KINDS: &str = "./crates/ra_syntax/src/syntax_kinds/generated.rs"; | ||
20 | const SYNTAX_KINDS_TEMPLATE: &str = "./crates/ra_syntax/src/syntax_kinds/generated.rs.tera"; | ||
21 | const AST: &str = "./crates/ra_syntax/src/ast/generated.rs"; | ||
22 | const AST_TEMPLATE: &str = "./crates/ra_syntax/src/ast/generated.rs.tera"; | ||
23 | 18 | ||
24 | fn main() -> Result<()> { | 19 | fn main() -> Result<()> { |
25 | let matches = App::new("tasks") | 20 | let matches = App::new("tasks") |
@@ -45,8 +40,8 @@ fn main() -> Result<()> { | |||
45 | fn run_gen_command(name: &str, verify: bool) -> Result<()> { | 40 | fn run_gen_command(name: &str, verify: bool) -> Result<()> { |
46 | match name { | 41 | match name { |
47 | "gen-kinds" => { | 42 | "gen-kinds" => { |
48 | update(Path::new(SYNTAX_KINDS), &render_template(SYNTAX_KINDS_TEMPLATE)?, verify)?; | 43 | update(&project_root().join(SYNTAX_KINDS), &render_template(project_root().join(SYNTAX_KINDS_TEMPLATE))?, verify)?; |
49 | update(Path::new(AST), &render_template(AST_TEMPLATE)?, verify)?; | 44 | update(&project_root().join(AST), &render_template(project_root().join(AST_TEMPLATE))?, verify)?; |
50 | }, | 45 | }, |
51 | "gen-tests" => { | 46 | "gen-tests" => { |
52 | gen_tests(verify)? | 47 | gen_tests(verify)? |