Skip to content

Commit

Permalink
move stylize around
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Jan 4, 2020
1 parent 3ed6a14 commit 9a538b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/nimph/project.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1301,10 +1301,6 @@ proc versionChangingCommits*(project: var Project): VersionTags =

proc pathForName*(group: ProjectGroup; name: string): Option[string] =
## try to retrieve the directory for a given import name in the group
{.warning: "replace this with compiler code".}
proc destylize(s: string): string =
result = s.toLowerAscii.replace("_")

let name = name.destylize
for project in group.values:
if project.importName.destylize == name:
Expand Down
5 changes: 5 additions & 0 deletions src/nimph/spec.nim
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,8 @@ proc forkTarget*(url: Uri): ForkTargetResult =
result.ok = result.owner.len > 0 and result.repo.len > 0
if not result.ok:
result.why = &"unable to parse url {result.url}"

{.warning: "replace this with compiler code".}
proc destylize*(s: string): string =
## this is how we create a uniformly comparable token
result = s.toLowerAscii.replace("_")

0 comments on commit 9a538b3

Please sign in to comment.