Permit numbers in module names
@@ -60,7 +60,14 @@ pub fn write_output(file: &OutputFile) -> Result<(), Error> {
fn is_gleam_path(path: &PathBuf, dir: &PathBuf) -> bool {
use regex::Regex;
lazy_static! {
- static ref RE: Regex = Regex::new("^([a-z_]+(/|\\\\))*[a-z_]+\\.gleam$")
+ static ref RE: Regex = Regex::new(
+ format!(
+ "^({module}{slash})*{module}\\.gleam$",
+ module = "[a-z][_a-z0-9]+",
+ slash = "(/|\\\\)",
+ )
+ .as_str()
+ )
.gleam_expect("is_gleam_path() RE regex");
}
