Branswe支持

This commit is contained in:
2026-01-31 23:36:50 +08:00
parent a974c1ff0f
commit b8cabfd1c0
5 changed files with 672 additions and 1 deletions

45
example.bran Normal file
View File

@@ -0,0 +1,45 @@
# Branswe代码示例
# 这个文件展示了Branswe编程语言的基本功能
# 示例1简单的Hello World
conshow hello
var(text) hello = Hello, Branswe!
# 示例2变量操作
var() name = LeonOS
var(text) greeting = Hello, name!
conshow greeting
# 示例3条件判断
if hello == hello
then
conshow match
else
conshow no match
end
# 示例4循环
loop 5
conshow count: i
var(text) count = i
conshow count: count
end
# 示例5计算
var(text) result = 10
var(text) num1 = 5
var(text) num2 = 3
rstr result + num1 + num2
conshow result
# 示例6扬声器响声
conbeep
# 示例7睡眠
sleep 1000
# 示例8清屏
concls
# 示例9结束
end