aboutsummaryrefslogtreecommitdiff
path: root/xtask
diff options
context:
space:
mode:
Diffstat (limited to 'xtask')
-rw-r--r--xtask/src/ast_src.rs11
-rw-r--r--xtask/src/codegen/gen_syntax.rs6
-rw-r--r--xtask/tests/tidy.rs7
3 files changed, 11 insertions, 13 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index adc191254..8ceaaf60e 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -71,16 +71,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
71 "trait", "true", "try", "type", "unsafe", "use", "where", "while", 71 "trait", "true", "try", "type", "unsafe", "use", "where", "while",
72 ], 72 ],
73 contextual_keywords: &["auto", "default", "existential", "union", "raw"], 73 contextual_keywords: &["auto", "default", "existential", "union", "raw"],
74 literals: &[ 74 literals: &["INT_NUMBER", "FLOAT_NUMBER", "CHAR", "BYTE", "STRING", "BYTE_STRING"],
75 "INT_NUMBER",
76 "FLOAT_NUMBER",
77 "CHAR",
78 "BYTE",
79 "STRING",
80 "RAW_STRING",
81 "BYTE_STRING",
82 "RAW_BYTE_STRING",
83 ],
84 tokens: &[ 75 tokens: &[
85 "ERROR", 76 "ERROR",
86 "IDENT", 77 "IDENT",
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs
index 02f4095ce..44460effa 100644
--- a/xtask/src/codegen/gen_syntax.rs
+++ b/xtask/src/codegen/gen_syntax.rs
@@ -504,7 +504,11 @@ impl Field {
504 504
505fn lower(grammar: &Grammar) -> AstSrc { 505fn lower(grammar: &Grammar) -> AstSrc {
506 let mut res = AstSrc::default(); 506 let mut res = AstSrc::default();
507 res.tokens = vec!["Whitespace".into(), "Comment".into(), "String".into(), "RawString".into()]; 507
508 res.tokens = "Whitespace Comment String ByteString IntNumber FloatNumber"
509 .split_ascii_whitespace()
510 .map(|it| it.to_string())
511 .collect::<Vec<_>>();
508 512
509 let nodes = grammar.iter().collect::<Vec<_>>(); 513 let nodes = grammar.iter().collect::<Vec<_>>();
510 514
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs
index 9de60c76c..99652e76b 100644
--- a/xtask/tests/tidy.rs
+++ b/xtask/tests/tidy.rs
@@ -214,8 +214,6 @@ fn check_todo(path: &Path, text: &str) {
214 // This file itself obviously needs to use todo (<- like this!). 214 // This file itself obviously needs to use todo (<- like this!).
215 "tests/cli.rs", 215 "tests/cli.rs",
216 // Some of our assists generate `todo!()`. 216 // Some of our assists generate `todo!()`.
217 "tests/generated.rs",
218 "handlers/add_missing_impl_members.rs",
219 "handlers/add_turbo_fish.rs", 217 "handlers/add_turbo_fish.rs",
220 "handlers/generate_function.rs", 218 "handlers/generate_function.rs",
221 // To support generating `todo!()` in assists, we have `expr_todo()` in 219 // To support generating `todo!()` in assists, we have `expr_todo()` in
@@ -228,6 +226,11 @@ fn check_todo(path: &Path, text: &str) {
228 return; 226 return;
229 } 227 }
230 if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") { 228 if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") {
229 // Generated by an assist
230 if text.contains("${0:todo!()}") {
231 return;
232 }
233
231 panic!( 234 panic!(
232 "\nTODO markers or todo! macros should not be committed to the master branch,\n\ 235 "\nTODO markers or todo! macros should not be committed to the master branch,\n\
233 use FIXME instead\n\ 236 use FIXME instead\n\