File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -545,6 +545,13 @@ where
545545 glob ( & path_joined. to_string_lossy ( ) ) . map_err ( |e| e. to_string ( ) ) ?
546546 {
547547 let path = path?;
548+ if let Some ( ext) = path. extension ( ) {
549+ if let Some ( ext) = ext. to_str ( ) {
550+ if ext. starts_with ( "grm" ) {
551+ Err ( ErrorString ( "test_files extensions beginning with `grm` are reserved." . into ( ) ) ) ?
552+ }
553+ }
554+ }
548555 let input = fs:: read_to_string ( & path) ?;
549556 let l: LRNonStreamingLexer < LexerTypesT > =
550557 closure_lexerdef. lexer ( & input) ;
Original file line number Diff line number Diff line change @@ -561,7 +561,18 @@ where
561561 }
562562 let mut input_paths = Vec :: new ( ) ;
563563 for path in paths {
564- input_paths. push ( path?) ;
564+ let path = path?;
565+ if let Some ( ext) = path. extension ( ) {
566+ if let Some ( ext) = ext. to_str ( ) {
567+ if ext. starts_with ( "grm" ) {
568+ Err ( NimbleparseError :: Other (
569+ "test_files extensions beginning with `grm` are reserved."
570+ . into ( ) ,
571+ ) ) ?
572+ }
573+ }
574+ }
575+ input_paths. push ( path) ;
565576 }
566577 input_paths
567578 } else {
You can’t perform that action at this time.
0 commit comments