1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-04-02 15:40:02 +08:00
parent 71c6127c6c
commit 3e4a62506b
2 changed files with 10 additions and 10 deletions

View File

@ -1 +1,2 @@
# back script #! yac.stack

View File

@ -1,3 +1,5 @@
#! yac.stack
func inputs(m, key) { func inputs(m, key) {
switch key { switch key {
case "name": case "name":
@ -7,6 +9,7 @@ func inputs(m, key) {
} }
} }
func list(m, arg, name) { func list(m, arg, name) {
defer func() { m.Echo("hello defer") }()
m.Push("h1", "hi").Push("h1", "he") m.Push("h1", "hi").Push("h1", "he")
m.Table(func(value) { m.Echo(value["h1"]) }) m.Table(func(value) { m.Echo(value["h1"]) })
info; m.Cmdy("cli.qrcode", "hello world") info; m.Cmdy("cli.qrcode", "hello world")
@ -16,9 +19,9 @@ func list1(m) {
let dict = kit.Dict("a", 1, "b", 2) let dict = kit.Dict("a", 1, "b", 2)
m.Echo("%#v", dict).Echo("\n") m.Echo("%#v", dict).Echo("\n")
m.Echo("%#v", dict["a"]).Echo("\n") m.Echo("%#v", dict["a"]).Echo("\n")
let list = kit.List("a", 1, "b", 2) let data = kit.List("a", 1, "b", 2)
m.Echo("%#v", list).Echo("\n") m.Echo("%#v", data).Echo("\n")
m.Echo("%#v", list[0]).Echo("\n") m.Echo("%#v", data[0]).Echo("\n")
} }
func list2(m, name) { func list2(m, name) {
if name == "h1" { if name == "h1" {
@ -32,11 +35,7 @@ func list2(m, name) {
func list3(m) { func list3(m) {
for i = 0; i < 10; i++ { for i = 0; i < 10; i++ {
m.Echo(i) m.Echo(i)
if i < 5 { if i < 5 { continue }
continue if i > 1 { break }
}
if i > 1 {
break
}
} }
} }