mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-13 15:38:06 -05:00
26 lines
472 B
Plaintext
26 lines
472 B
Plaintext
export @main { "main": @main }
|
|
|
|
@main = function() {
|
|
call @f1_default [1, 2, 3] %x
|
|
call @f2_f2 [%x] %x
|
|
subcall @util_star "dist" [3, 4] %dist
|
|
mov [%x, %dist] %return
|
|
}
|
|
|
|
@f1_default = function(%a, %b, %c) {
|
|
op* %b %c %_tmp0
|
|
op+ %a %_tmp0 %return
|
|
}
|
|
|
|
@f2_f2 = function(%x) {
|
|
op++ %x
|
|
}
|
|
|
|
@util_star = { "dist": @util_dist }
|
|
|
|
@util_dist = function(%x, %y) {
|
|
op* %x %x %_tmp0
|
|
op* %y %y %_tmp1
|
|
op+ %_tmp0 %_tmp1 %_tmp1
|
|
subcall $Math "sqrt" [%_tmp1] %return
|
|
} |