Skip to content

Commit

Permalink
0.9.496
Browse files Browse the repository at this point in the history
- Fixes
  • Loading branch information
RobbyV2 committed Nov 22, 2024
1 parent e179e5f commit e8cb3bb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "fplc"
version = "0.9.495"
version = "0.9.496"
edition = "2021"
description = "A pseudolang interpreter written in Rust"

Expand Down
4 changes: 2 additions & 2 deletions installer/pseudolang.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

!define MUI_ICON "Pseudolang-Logo.ico"

Name "PseudoLang Installer v0.9.495"
Name "PseudoLang Installer v0.9.496"
InstallDir "$PROGRAMFILES\PseudoLang\"
OutFile "../release/installer/pseudolang-setup-x64.exe"
BrandingText "(c) 2024 PseudoLang Software Foundation"
Expand Down Expand Up @@ -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.495"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayVersion" "0.9.496"
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"

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div align="center">
<p>
<img src="https://github.com/PseudoLang-Software-Foundation/Pseudolang/actions/workflows/build.yml/badge.svg" alt="Build and Test Pseudolang">
<img src="https://img.shields.io/badge/Version-0.9.495-green" alt="Version">
<img src="https://img.shields.io/badge/Version-0.9.496-green" alt="Version">
<a href="https://nightly.link/PseudoLang-Software-Foundation/Pseudolang/workflows/build/main"><img src="https://img.shields.io/badge/Nightly-Releases-purple" alt="Nightly Releases"></a>
</p>
</div>
Expand Down Expand Up @@ -61,7 +61,6 @@ The file `src/tests/mod.rs` also contains various unit tests (examples of code)

- [ ] Dictionaries
- [ ] Better error handling (line, column)
- [ ] Time
- [ ] Networking
- [ ] File IO
- [ ] System integration (terminal commands, process management, environment variables)
Expand All @@ -75,6 +74,7 @@ The file `src/tests/mod.rs` also contains various unit tests (examples of code)
<summary>Misc</summary>

- [ ] Testing for INPUT and SLEEP (mocking framework)
- [ ] More escape characters

</details>
</details>
Expand Down
6 changes: 3 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ impl Parser {
if !self.match_token(&Token::OpenParen) {
return Err("Expected '(' after INPUT".to_string());
}
let prompt = if let Some(Token::String(_)) = self.peek() {
let prompt = if self.peek() != Some(&Token::CloseParen) {
Some(Box::new(self.parse_expression(debug)?))
} else {
None
};
if !self.match_token(&Token::CloseParen) {
return Err("Expected ')' after INPUT expression".to_string());
return Err("Expected ')' after INPUT".to_string());
}
Ok(AstNode::Input(prompt))
}
Expand Down Expand Up @@ -671,7 +671,7 @@ impl Parser {
if !self.match_token(&Token::OpenParen) {
return Err("Expected '(' after INPUT".to_string());
}
let prompt = if let Some(Token::String(_)) = self.peek() {
let prompt = if self.peek() != Some(&Token::CloseParen) {
Some(Box::new(self.parse_expression(debug)?))
} else {
None
Expand Down
28 changes: 18 additions & 10 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ mod test {
}
}

#[test]
fn test_display() {
assert_output("DISPLAY(42)", "42");
assert_output("DISPLAY(TRUE)", "true");
assert_output(r#"DISPLAY("Hello")"#, "Hello");
assert_output("DISPLAY([1, 2, 3])", "[1, 2, 3]");
assert_output("DISPLAY(5.5)", "5.5");
assert_output("DISPLAY(-42)", "-42");
assert_output("DISPLAY(FALSE)", "false");
assert_output("DISPLAY([])", "[]");
assert_output(
r#"
DISPLAYINLINE("Hello, ")
DISPLAYINLINE("World!")"#,
"Hello, World!",
);
}

#[test]
fn test_basic_arithmetic() {
assert_output("DISPLAY(5 + 3)", "8");
Expand Down Expand Up @@ -1136,16 +1154,6 @@ DISPLAY(str[0])"#,
}
}

#[test]
fn test_misc() {
assert_output(
r#"
DISPLAYINLINE("Hello, ")
DISPLAYINLINE("World!")"#,
"Hello, World!",
);
}

#[test]
fn test_merge_sort() {
assert_output(
Expand Down

0 comments on commit e8cb3bb

Please sign in to comment.