Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lrlex/src/lib/ctbuilder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,13 @@ where
glob(&path_joined.to_string_lossy()).map_err(|e| e.to_string())?
{
let path = path?;
if let Some(ext) = path.extension() {
if let Some(ext) = ext.to_str() {
if ext.starts_with("grm") {
Err(ErrorString("test_files extensions beginning with `grm` are reserved.".into()))?
}
}
}
let input = fs::read_to_string(&path)?;
let l: LRNonStreamingLexer<LexerTypesT> =
closure_lexerdef.lexer(&input);
Expand Down
13 changes: 12 additions & 1 deletion nimbleparse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,18 @@ where
}
let mut input_paths = Vec::new();
for path in paths {
input_paths.push(path?);
let path = path?;
if let Some(ext) = path.extension() {
if let Some(ext) = ext.to_str() {
if ext.starts_with("grm") {
Err(NimbleparseError::Other(
"test_files extensions beginning with `grm` are reserved."
.into(),
))?
}
}
}
input_paths.push(path);
}
input_paths
} else {
Expand Down