Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,9 @@
if .x == 0 {
...
} else if .x > 0 {
val .y = 100
...
} else {
val .y = 70
...
}

View file

@ -0,0 +1 @@
if(.x > .y: ...; .x < .y: ...; /* else */ ...)

View file

@ -0,0 +1 @@
if .x > .y: break

View file

@ -0,0 +1,25 @@
switch .x, .y, .z {
case true: ...
# any are true
case false, _: ...
# .x == false
case _, null, true: ...
# .y == null or .z == true
case xor _, true, true: ...
# .y == true xor .z == true
}
switch 0 {
case .x, .y: ...
# .x or .y equals 0
...
}
given .x, .y, .z {
case true: ...
# all are true
case false, _: ...
# .x == false
case _, null, true: ...
# .y == null and .z == true
}

View file

@ -0,0 +1,7 @@
given .x {
case true:
# implicit fallthrough
case null: 0
# no fallthrough
default: 1
}

View file

@ -0,0 +1,9 @@
given .x {
case true:
if .y > 100 {
fallthrough
} else {
120
}
case false: ...
}

View file

@ -0,0 +1,4 @@
given(.x, .y, .z;
true: ... ; # all are equal to true
_, >= .z: ...; # .y >= .z
... ) # default