Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
switch .x {
switch x {
case true:
# implicit fallthrough
case null: 0

View file

@ -1,6 +1,6 @@
switch .x {
switch x {
case true:
if .y > 100 {
if y > 100 {
fallthrough
} else {
120

View file

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

View file

@ -0,0 +1,28 @@
// if statement
if condition then
operator;
if condition then
operator
else operator;
if condition then
operator
else if condition then
operator
else operator;
// case statement
case Month of
3..5: Print('Spring');
6..8: Print('Summer');
9..11: Print('Autumn');
12,1,2: Print('Winter');
else throw ArgumentException('Bad Month')
end;
// ternary operator
var min := if a < b then a else b;
// ternary operator in C style
var min := a < b ? a : b;