diff --git a/Cargo.lock b/Cargo.lock index 202f5bf..1844377 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -102,7 +102,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "fplc" -version = "0.9.496" +version = "0.9.497" dependencies = [ "chrono", "chrono-tz", diff --git a/Cargo.toml b/Cargo.toml index 760a101..4914fa3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "fplc" -version = "0.9.496" +version = "0.9.497" edition = "2021" description = "A pseudolang interpreter written in Rust" diff --git a/Pseudolang.md b/Pseudolang.md index 87e9212..ea5a981 100644 --- a/Pseudolang.md +++ b/Pseudolang.md @@ -255,6 +255,10 @@ Evaluates to the number of elements in aList (1 through length). Returns a new list that is a sorted version of `aList` (must be an array of integers). The sorting is done in ascending order. +`RANGE(start (optional), end)` + +Creates a new list containing integers from start (1 by default) to end inclusive. + `aList + bList` The `+` operator can be used to concatenate two lists. This creates a new list containing all the elements of `aList` followed by all the elements of `bList`. diff --git a/installer/pseudolang.nsi b/installer/pseudolang.nsi index e1304c8..87d9274 100644 --- a/installer/pseudolang.nsi +++ b/installer/pseudolang.nsi @@ -4,7 +4,7 @@ !define MUI_ICON "Pseudolang-Logo.ico" -Name "PseudoLang Installer v0.9.496" +Name "PseudoLang Installer v0.9.497" InstallDir "$PROGRAMFILES\PseudoLang\" OutFile "../release/installer/pseudolang-setup-x64.exe" BrandingText "(c) 2024 PseudoLang Software Foundation" @@ -33,7 +33,7 @@ Section "" WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$INSTDIR;$R0" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayName" "Pseudolang" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayVersion" "0.9.496" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayVersion" "0.9.497" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "Publisher" "Pseudolang Software Foundation" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayIcon" "$INSTDIR\Pseudolang-Logo.ico" diff --git a/readme.md b/readme.md index 87cc1b4..82ad09c 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@
diff --git a/src/interpreter.rs b/src/interpreter.rs index d8223d7..15ab1a4 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -832,6 +832,39 @@ fn evaluate_node( _ => Err("FIND requires two string arguments".to_string()), } } + "RANGE" => match args.len() { + 1 => { + let end = evaluate_node(&args[0], Rc::clone(&env), debug)?; + if let Value::Integer(end_val) = end { + if end_val < 1 { + return Err("RANGE end value must be greater than 0".to_string()); + } + let list: Vec