Commit 857ba0a 1 parent ad77e7e commit 857ba0a Copy full SHA for 857ba0a
File tree 5 files changed +13
-4
lines changed
5 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ namespace SearchPath
33
33
`ext` (`lean` or `olean`) corresponding to `mod`. Otherwise, return `none`. Does
34
34
not check whether the returned path exists. -/
35
35
def findWithExt (sp : SearchPath) (ext : String) (mod : Name) : IO (Option FilePath) := do
36
- let pkg := mod.getRoot.toString
36
+ let pkg := mod.getRoot.toString (escape := false )
37
37
let root? ← sp.findM? fun p =>
38
38
(p / pkg).isDir <||> ((p / pkg).withExtension ext).pathExists
39
39
return root?.map (modToFilePath · mod ext)
@@ -94,7 +94,7 @@ partial def findOLean (mod : Name) : IO FilePath := do
94
94
if let some fname ← sp.findWithExt "olean" mod then
95
95
return fname
96
96
else
97
- let pkg := FilePath.mk mod.getRoot.toString
97
+ let pkg := FilePath.mk <| mod.getRoot.toString (escape := false )
98
98
let mut msg := s! "unknown package '{ pkg} '"
99
99
let rec maybeThisOne dir := do
100
100
if ← (dir / pkg).isDir then
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ def initPkg (dir : FilePath) (name : String) (tmp : InitTemplate) (env : Lake.En
169
169
if tmp = .exe || rootExists then
170
170
pure (root, rootFile, rootExists)
171
171
else
172
- let root := toUpperCamelCase (toUpperCamelCaseString name |>.toName)
172
+ let root := toUpperCamelCase pkgName
173
173
let rootFile := Lean.modToFilePath dir root "lean"
174
174
pure (root, rootFile, ← rootFile.pathExists)
175
175
Original file line number Diff line number Diff line change 2
2
/hello_world
3
3
/hello-world
4
4
/lean-data
5
+ /123-hello
5
6
/meta
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ rm -rf Hello
2
2
rm -rf hello-world
3
3
rm -rf hello_world
4
4
rm -rf lean-data
5
+ rm -rf 123-hello
5
6
rm -rf meta
Original file line number Diff line number Diff line change @@ -24,13 +24,20 @@ $LAKE -d hello-world build
24
24
hello-world/.lake/build/bin/hello-world
25
25
test -f hello-world/Hello/World/Basic.lean
26
26
27
- # Test creating packages with a `-` (i.e., a non-Lean name)
27
+ # Test creating packages with a `-` (i.e., a non-identifier package name)
28
28
# https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/lake.20new.20lean-data
29
29
30
30
$LAKE new lean-data
31
31
$LAKE -d lean-data build
32
32
lean-data/.lake/build/bin/lean-data
33
33
34
+ # Test creating packages starting with digits (i.e., a non-identifier library name)
35
+ # https://github.com/leanprover/lean4/issues/2865
36
+
37
+ $LAKE new 123-hello
38
+ $LAKE -d 123-hello build
39
+ 123-hello/.lake/build/bin/123-hello
40
+
34
41
# Test creating packages with keyword names
35
42
# https://github.com/leanprover/lake/issues/128
36
43
You can’t perform that action at this time.
0 commit comments