Skip to content

Commit

Permalink
Fix for isuue #398
Browse files Browse the repository at this point in the history
  • Loading branch information
leh103 committed Mar 9, 2019
1 parent 16abdd1 commit eac96a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dlangide/workspace/project.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import std.file;
import std.path;
import std.process;
import std.utf;
import std.ascii : isAlphaNum;

string[] includePath;

Expand Down Expand Up @@ -934,19 +935,19 @@ class DubPackageFinder {
bool isValidProjectName(in string s) pure {
if (s.empty)
return false;
return reduce!q{ a && (b == '_' || b == '-' || std.ascii.isAlphaNum(b)) }(true, s);
return reduce!((a, b) => a && (b == '_' || b == '-' || isAlphaNum(b)))(true, s);
}

bool isValidModuleName(in string s) pure {
if (s.empty)
return false;
return reduce!q{ a && (b == '_' || std.ascii.isAlphaNum(b)) }(true, s);
return reduce!((a, b) => a && (b == '_' || isAlphaNum(b)))(true, s);
}

bool isValidFileName(in string s) pure {
if (s.empty)
return false;
return reduce!q{ a && (b == '_' || b == '.' || b == '-' || std.ascii.isAlphaNum(b)) }(true, s);
return reduce!((a, b) => a && (b == '_' || b == '.' || b == '-' || isAlphaNum(b)))(true, s);
}

unittest {
Expand Down

0 comments on commit eac96a7

Please sign in to comment.