diff --git a/Cargo.lock b/Cargo.lock index da20c41d..3d262a8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,7 +62,7 @@ dependencies = [ [[package]] name = "bend-lang" -version = "0.2.23" +version = "0.2.24" dependencies = [ "TSPL", "clap", diff --git a/Cargo.toml b/Cargo.toml index 9fe0f30c..c0e0fc55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "bend-lang" description = "A high-level, massively parallel programming language" license = "Apache-2.0" -version = "0.2.23" +version = "0.2.24" edition = "2021" rust-version = "1.74" exclude = ["tests/snapshots/"] diff --git a/cspell.json b/cspell.json index 44d5b747..9f352bbd 100644 --- a/cspell.json +++ b/cspell.json @@ -32,6 +32,7 @@ "dref", "dups", "effectful", + "elifs", "foldl", "hasher", "hexdigit", @@ -120,10 +121,7 @@ "walkdir", "wopts" ], - "files": [ - "**/*.rs", - "**/*.md" - ], + "files": ["**/*.rs", "**/*.md"], "ignoreRegExpList": [ "HexValues", "/λ/g", diff --git a/docs/syntax.md b/docs/syntax.md index 9cb9d5b9..61bcd0b1 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -193,6 +193,19 @@ A branching statement where `else` is mandatory. The condition must return a `u24` number, where 0 will run the `else` branch and any other value will return the first one. +It is possible to make if-chains using `elif`: + +```python +if condition1: + return 0 +elif condition2: + return 1 +elif condition3: + return 2 +else: + return 3 +``` + ### Switch ```python