Skip to content

Commit

Permalink
Added support for - _ chars in filenames/folders
Browse files Browse the repository at this point in the history
  • Loading branch information
scambier committed Jun 20, 2021
1 parent 55e75fa commit 4fa1259
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl FileType {
// (\n|[\r\n]+) is a fix for the EOL symbol ($) not working on Windows CRLF

// Regex for `include "my.module"`
let regex = Regex::new(r#"(?m)^include "([a-zA-Z\.]+)"(\n|[\r\n]+)"#).unwrap();
let regex = Regex::new(r#"(?m)^include "([a-zA-Z\-_\.]+)"(\n|[\r\n]+)"#).unwrap();

let ext = filename.extension().unwrap().to_str().unwrap();
let extension = ext.to_string();
Expand All @@ -32,7 +32,7 @@ impl FileType {
"fnl" => FileType {
extension,
// Regex for `(include "my.module")`
regex: Regex::new(r#"(?m)^\(include "([a-zA-Z\.]+)"\)(\n|[\r\n]+)"#).unwrap(),
regex: Regex::new(r#"(?m)^\(include "([a-zA-Z\-_\.]+)"\)(\n|[\r\n]+)"#).unwrap(),
comment: ";;".to_string(),
},
"wren" => FileType {
Expand All @@ -43,7 +43,7 @@ impl FileType {
"nut" | "js" => FileType {
extension,
// Regex for `include("my.module")`
regex: Regex::new(r#"(?m)^include\("([a-zA-Z\.]+)"\)(\n|[\r\n]+)"#).unwrap(),
regex: Regex::new(r#"(?m)^include\("([a-zA-Z\-_\.]+)"\)(\n|[\r\n]+)"#).unwrap(),
comment: "//".to_string(),
},
_ => {
Expand Down

0 comments on commit 4fa1259

Please sign in to comment.