File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,18 @@ static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
166166 . unwrap ( )
167167} ) ;
168168
169+ static DEPRECATED_LINE_PATTERN : LazyLock < Regex > = LazyLock :: new ( || {
170+ RegexBuilder :: new (
171+ r#"
172+ //\s+@
173+ "# ,
174+ )
175+ . ignore_whitespace ( true )
176+ . unicode ( true )
177+ . build ( )
178+ . unwrap ( )
179+ } ) ;
180+
169181fn print_err ( msg : & str , lineno : usize ) {
170182 eprintln ! ( "Invalid command: {} on line {}" , msg, lineno)
171183}
@@ -183,6 +195,12 @@ fn get_commands(template: &str) -> Result<Vec<Command>, ()> {
183195 for ( lineno, line) in file. split ( '\n' ) . enumerate ( ) {
184196 let lineno = lineno + 1 ;
185197
198+ if DEPRECATED_LINE_PATTERN . is_match ( line) {
199+ print_err ( "Deprecated command syntax, replace `// @` with `//@ `" , lineno) ;
200+ errors = true ;
201+ continue ;
202+ }
203+
186204 let Some ( cap) = LINE_PATTERN . captures ( line) else {
187205 continue ;
188206 } ;
You can’t perform that action at this time.
0 commit comments