Files
aego/tests/scripts/syntax.aes
T
sanspie 17cb5e4291 Stage 2-5: assets, scene/ECS, editor, 3D, and Aego Script
Stage 2: render pipeline and UI toolkit over gpu/platform.
Stage 3: schema registry, asset pipeline + runtime loader, scene graph and ECS.
Stage 4: editor — docking, inspector, scene/game views, play mode, asset browser, console, profiler; 4.5 adds the 3D foundation (mixed 2D/3D spaces, meshes, depth).
Stage 5: Aego Script — compiler (lexer/parser/types/resolver/checker/asm/compiler), bytecode with verifier and register VM, instance runtime, stdlib, native bindings, and editor/CLI integration (aego run/edit/check/test/dump).
2026-10-08 13:17:28 +03:00

66 lines
881 B
Plaintext

package syntax
import (
"aego/log"
"aego/math"
)
const Limit int = 1_000
const Ratio = .5
const Name = "syn\ttax"
enum Mode {
Off
On
}
type Pair struct {
A int
B float
}
func add(a int, b int) int {
return a + b
}
@hide
@former("OldSyntax")
script Syntax {
@export(min=-1, max=10, unit="m", display="Count")
var Count int = 3
var items []int
var pair Pair
var mode Mode
func Ready() {
pair = Pair{A: 1, B: 2.5}
items = append(items, add(1, 2))
for i := 0; i < len(items); i++ {
items[i] *= 2
}
for Count > 0 {
Count--
}
for {
break
}
switch mode {
case Mode.Off, Mode.On:
log.Info("mode")
default:
return
}
if !(Count >= 1 && pair.A != 0) || Ratio < 1e3 {
var x float = -math.Abs(-1.5)
x += float(Count) * 0x1f
} else if node.Has<SpriteRenderer>() {
{
continue
}
} else {
mode = Mode.On
}
}
}