提交 ab797adf 编写于 作者: chai2010's avatar chai2010

增加通过 api 执行 wz 例子(尚不能运行)

上级 ecb3f3a3
......@@ -13,7 +13,15 @@ import (
)
func main() {
output, err := api.RunCode("hello.wa", code)
output, err := api.RunCode(api.DefaultConfig(), "hello.wa", code)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Print(string(output))
output, err = api.RunCode(api.DefaultConfig(), "hello-zh.wz", code_zh)
if err != nil {
fmt.Println(err)
os.Exit(1)
......@@ -31,3 +39,12 @@ func add(a: i32, b: i32) => i32 {
return a+b
}
`
const code_zh = `// 版权 @2022 _examples/hello 作者。保留所有权利。
引于 "书"
【启】:
书·说:"你好,凹语言!"
`
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册