package-type imports

This commit is contained in:
2026-06-10 00:08:33 +02:00
parent 087fdb45d5
commit d6e03b6f08
104 changed files with 1799 additions and 273 deletions
+3
View File
@@ -0,0 +1,3 @@
import "/definitely/not/a/brolang/package"
main :: func() void {}
@@ -0,0 +1,6 @@
math i32 :: 7
import "../math"
main :: func() i32 {
return math
}
@@ -0,0 +1 @@
value i32 :: 2
+6
View File
@@ -0,0 +1,6 @@
left :: import "../math"
right :: import "../math"
main :: func() i32 {
return left.value + right.value
}
+1
View File
@@ -0,0 +1 @@
value i32 :: 2
+1
View File
@@ -0,0 +1 @@
This non-Brolang file must not be loaded as part of the package.
+5
View File
@@ -0,0 +1,5 @@
import "../math"
main :: func() i32 {
return math.sum(local_value, math.value)
}
@@ -0,0 +1 @@
this is deliberately invalid and must not be loaded
+1
View File
@@ -0,0 +1 @@
local_value i32 :: 1
+5
View File
@@ -0,0 +1,5 @@
value i32 :: 2
sum :: func(a, b i32) i32 {
return a + b
}
+7
View File
@@ -0,0 +1,7 @@
import "../left"
import "../right"
main :: func() void {
_ = left.same()
_ = right.same()
}
@@ -0,0 +1,3 @@
same :: c func() int {
return 1
}
@@ -0,0 +1,3 @@
same :: c func() int {
return 2
}
+7
View File
@@ -0,0 +1,7 @@
import "../b"
seed i32 :: 4
run :: func() i32 {
return b.value
}
+5
View File
@@ -0,0 +1,5 @@
import "../a"
main :: func() i32 {
return a.run()
}
+3
View File
@@ -0,0 +1,3 @@
import "../a"
value i32 :: a.seed
@@ -0,0 +1 @@
value i32 :: 9
@@ -0,0 +1,5 @@
import "./level_three"
value :: func() i32 {
return level_three.value
}
@@ -0,0 +1,5 @@
import "./level_two"
value :: func() i32 {
return level_two.value()
}
+5
View File
@@ -0,0 +1,5 @@
import "./level_one"
main :: func() i32 {
return level_one.value()
}
@@ -0,0 +1,3 @@
import "../bad-name"
main :: func() void {}
@@ -0,0 +1 @@
value i32 :: 3
+6
View File
@@ -0,0 +1,6 @@
math :: import "../math"
math :: import "../math"
main :: func() i32 {
return math.value
}
@@ -0,0 +1 @@
value i32 :: 2
@@ -0,0 +1,3 @@
import "../eager"
main :: func() void {}
@@ -0,0 +1,2 @@
base i8 :: 127
overflow i8 :: base + 1
+1
View File
@@ -0,0 +1 @@
An empty root package has no immediate .bro files and is an infrastructure error.
@@ -0,0 +1,3 @@
import "../empty"
main :: func() void {}
@@ -0,0 +1 @@
This imported package intentionally has no .bro files.
@@ -0,0 +1,5 @@
good :: import "../bad-name"
main :: func() i32 {
return good.value
}
@@ -0,0 +1 @@
value i32 :: 3
@@ -0,0 +1,3 @@
import "../not_package.bro"
main :: func() void {}
@@ -0,0 +1 @@
main :: func() void {}
+5
View File
@@ -0,0 +1,5 @@
import "../math"
used_here :: func() int {
return math.value
}
+8
View File
@@ -0,0 +1,8 @@
not_imported_here :: func() int {
return math.value
}
main :: func() void {
_ = used_here()
_ = not_imported_here()
}
@@ -0,0 +1 @@
value :: 1
+5
View File
@@ -0,0 +1,5 @@
import "../math"
main :: func() i32 {
return math.identity(127 + 1)
}
+3
View File
@@ -0,0 +1,3 @@
identity :: func(value int) int {
return value
}
+3
View File
@@ -0,0 +1,3 @@
import "../b"
value i32 :: b.value
@@ -0,0 +1,5 @@
import "../a"
main :: func() void {
_ = a.value
}
+3
View File
@@ -0,0 +1,3 @@
import "../a"
value i32 :: a.value
@@ -0,0 +1,5 @@
main :: func() i32 {
return math.value
}
import "../math"
@@ -0,0 +1 @@
value i32 :: 6
@@ -0,0 +1,5 @@
import "../dep"
main :: func() i32 {
return dep.main()
}
@@ -0,0 +1,3 @@
main :: func() i32 {
return 7
}
@@ -0,0 +1,7 @@
import "../math"
unused :: func() int {
return math.missing
}
main :: func() void {}
@@ -0,0 +1 @@
value :: 7
@@ -0,0 +1,3 @@
import "../dep"
value :: dep.main()
@@ -0,0 +1,3 @@
main :: func() i32 {
return 1
}
@@ -0,0 +1,3 @@
import "../missing"
main :: func() void {}
@@ -0,0 +1,5 @@
import "../missing"
main :: func() void {
_ = missing.value
}
@@ -0,0 +1,5 @@
import "../bridge"
main :: func() void {
_ = bridge.value
}
@@ -0,0 +1,5 @@
import "../math"
read :: func() i32 {
return math.value
}
@@ -0,0 +1 @@
value i32 :: 2
@@ -0,0 +1,3 @@
import "../broken"
main :: func() void {}
@@ -0,0 +1 @@
bad = 1
@@ -0,0 +1,9 @@
import "../math"
read :: func(value i8) int {
return math.value
}
main :: func() i32 {
return read(1)
}
@@ -0,0 +1 @@
value i16 :: 300
+5
View File
@@ -0,0 +1,5 @@
import "../b"
one :: func(value int) i32 {
return b.two(value)
}
+5
View File
@@ -0,0 +1,5 @@
import "../a"
main :: func() i32 {
return a.one(1)
}
+5
View File
@@ -0,0 +1,5 @@
import "../a"
two :: func(value int) i32 {
return a.one(value)
}
+5
View File
@@ -0,0 +1,5 @@
import "../math"
from_a :: func() i32 {
return math.value
}
+5
View File
@@ -0,0 +1,5 @@
import "../math"
main :: func() i32 {
return from_a() + math.value
}
+1
View File
@@ -0,0 +1 @@
value i32 :: 2
@@ -0,0 +1,7 @@
self :: import "."
value i32 :: 5
main :: func() i32 {
return self.value
}
+3
View File
@@ -0,0 +1,3 @@
import "../math"
main :: func() void {}
+1
View File
@@ -0,0 +1 @@
value :: 1