build: separate compiler and libs

This commit is contained in:
Li Jie
2025-01-07 21:49:08 +08:00
parent b0123567cd
commit 1172e5bdce
559 changed files with 190 additions and 176 deletions

View File

@@ -0,0 +1,33 @@
package main
type point struct {
x int
y int
}
type N [2]int
type T *N
type S []int
func main() {
a := [...]point{{1, 2}, {3, 4}, {5, 6}}[2]
println(a.x, a.y)
b := [...][2]int{[2]int{1, 2}, [2]int{3, 4}}[1]
println(b[0], b[1])
var i int = 2
println([...]int{1, 2, 3, 4, 5}[i])
s := "123456"
println(string(s[i]))
println(string("123456"[1]))
var n = N{1, 2}
var t T = &n
println(t[1])
var s1 = S{1, 2, 3, 4}
println(s1[1])
println([2]int{}[0])
}