pyvm: split op handlers into ops_core/ops_box/ops_ctrl; add ops_flow + intrinsic; delegate vm.py without behavior change
net-plugin: modularize constants (consts.rs) and sockets (sockets.rs); remove legacy commented socket code; fix unused imports mir: move instruction unit tests to tests/mir_instruction_unit.rs (file lean-up); no semantic changes runner/pyvm: ensure using pre-strip; misc docs updates Build: cargo build ok; legacy cfg warnings remain as before
This commit is contained in:
5
apps/tests/macro/if/assign_join_basic.nyash
Normal file
5
apps/tests/macro/if/assign_join_basic.nyash
Normal file
@ -0,0 +1,5 @@
|
||||
function main(args) {
|
||||
local a = 0
|
||||
if 1 { a = 1 } else { a = 2 }
|
||||
}
|
||||
|
||||
17
apps/tests/macro/if/assign_three_vars.nyash
Normal file
17
apps/tests/macro/if/assign_three_vars.nyash
Normal file
@ -0,0 +1,17 @@
|
||||
function main(args) {
|
||||
local a, b, c
|
||||
local d = 1
|
||||
if d == 1 {
|
||||
a = 1
|
||||
b = 2
|
||||
c = 3
|
||||
} else {
|
||||
a = 10
|
||||
b = 20
|
||||
c = 30
|
||||
}
|
||||
print(a)
|
||||
print(b)
|
||||
print(c)
|
||||
}
|
||||
|
||||
15
apps/tests/macro/if/assign_two_vars.nyash
Normal file
15
apps/tests/macro/if/assign_two_vars.nyash
Normal file
@ -0,0 +1,15 @@
|
||||
function main(args) {
|
||||
local x, y
|
||||
local c = 1
|
||||
if c == 1 {
|
||||
x = 10
|
||||
y = 20
|
||||
} else {
|
||||
x = 30
|
||||
y = 40
|
||||
}
|
||||
// ensure use
|
||||
print(x)
|
||||
print(y)
|
||||
}
|
||||
|
||||
8
apps/tests/macro/if/then_only.nyash
Normal file
8
apps/tests/macro/if/then_only.nyash
Normal file
@ -0,0 +1,8 @@
|
||||
function main(args) {
|
||||
local x = 0
|
||||
if 1 {
|
||||
x = 42
|
||||
print(x)
|
||||
}
|
||||
}
|
||||
|
||||
11
apps/tests/macro/if/with_else.nyash
Normal file
11
apps/tests/macro/if/with_else.nyash
Normal file
@ -0,0 +1,11 @@
|
||||
function main(args) {
|
||||
local x
|
||||
local c = 0
|
||||
if c == 1 {
|
||||
x = 10
|
||||
} else {
|
||||
x = 20
|
||||
}
|
||||
print(x)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user