File tree 1 file changed +18
-0
lines changed
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(|| {
166
166
. unwrap ( )
167
167
} ) ;
168
168
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
+
169
181
fn print_err ( msg : & str , lineno : usize ) {
170
182
eprintln ! ( "Invalid command: {} on line {}" , msg, lineno)
171
183
}
@@ -183,6 +195,12 @@ fn get_commands(template: &str) -> Result<Vec<Command>, ()> {
183
195
for ( lineno, line) in file. split ( '\n' ) . enumerate ( ) {
184
196
let lineno = lineno + 1 ;
185
197
198
+ if DEPRECATED_LINE_PATTERN . is_match ( line) {
199
+ print_err ( "Deprecated command syntax, replace `// @` with `//@ `" , lineno) ;
200
+ errors = true ;
201
+ continue ;
202
+ }
203
+
186
204
let Some ( cap) = LINE_PATTERN . captures ( line) else {
187
205
continue ;
188
206
} ;
You can’t perform that action at this time.
0 commit comments