Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ jobs:
run: cargo fmt --all -- --check
- name: Check compilation
run: cargo check --all-targets
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Snapshot: 2026-07-28.
- `cargo fmt --all -- --check` passes and is enforced for pull requests.
- `cargo check --all-targets` passes.
- `cargo test` passes and is enforced for pull requests, including all 48 integration specifications and the library doctest.
- `cargo clippy --all-targets --all-features -- -D warnings` passes locally.
- `cargo clippy --all-targets --all-features -- -D warnings` passes and is enforced for pull requests.
- The crate exposes checked file/source execution APIs and typed I/O, parse, and runtime error categories.
- Lexer, parser, interpreter, type-inference, examples, mdBook documentation, and cargo-dist release assets exist.

Expand Down Expand Up @@ -73,7 +73,7 @@ Snapshot: 2026-07-28.
- [x] Fix the library doctest against the v0.1 API, make `cargo test` green, and require it in CI.
- [x] Resolve strict Clippy findings in the interpreter without lint suppressions or behavior changes.
- [x] Resolve the remaining strict Clippy findings in the lexer, parser, type inference, and symbol table.
- [ ] Require `cargo clippy --all-targets --all-features -- -D warnings` in pull-request CI.
- [x] Require `cargo clippy --all-targets --all-features -- -D warnings` in pull-request CI.
- [ ] Separate generated mdBook output from sources and define one reproducible documentation build command.
- [ ] Reconcile README commands, branch names, CI claims, supported features, and examples with executable behavior.
- [ ] Add focused lexer/parser error tests for malformed strings, comments, UTF-8 input, and unexpected EOF.
Expand Down
14 changes: 7 additions & 7 deletions src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,23 @@ impl Value {
(Value::Int(a), Value::Int(b)) => Value::Int(a + b),
(Value::Float(a), Value::Float(b)) => Value::Float(a + b),
(Value::String(a), Value::String(b)) => Value::String(a + &b),
(a, b) => panic!("Adding mismatched types {:?} and {:?}", &a, &b),
(a, b) => panic!("Adding mismatched types {:?} and {:?}", a, b),
}
}

fn sub(self, other: Value) -> Value {
match (self, other) {
(Value::Int(a), Value::Int(b)) => Value::Int(a - b),
(Value::Float(a), Value::Float(b)) => Value::Float(a - b),
(a, b) => panic!("Subtracting mismatched types {:?} and {:?}", &a, &b),
(a, b) => panic!("Subtracting mismatched types {:?} and {:?}", a, b),
}
}

fn mul(self, other: Value) -> Value {
match (self, other) {
(Value::Int(a), Value::Int(b)) => Value::Int(a * b),
(Value::Float(a), Value::Float(b)) => Value::Float(a * b),
(a, b) => panic!("Multiplying mismatched types {:?} and {:?}", &a, &b),
(a, b) => panic!("Multiplying mismatched types {:?} and {:?}", a, b),
}
}

Expand Down Expand Up @@ -165,7 +165,7 @@ impl Value {
(Value::Float(a), Value::Float(b)) => Value::Boolean(a < b),
(a, b) => panic!(
"Comparison operator < on mismatched types {:?} and {:?}",
&a, &b
a, b
),
}
}
Expand All @@ -176,7 +176,7 @@ impl Value {
(Value::Float(a), Value::Float(b)) => Value::Boolean(a > b),
(a, b) => panic!(
"Comparison operator > on mismatched types {:?} and {:?}",
&a, &b
a, b
),
}
}
Expand All @@ -191,7 +191,7 @@ impl Value {

(a, b) => panic!(
"Comparison operator == on mismatched types {:?} and {:?}",
&a, &b
a, b
),
}
}
Expand All @@ -204,7 +204,7 @@ impl Value {
(Value::String(a), Value::String(b)) => Value::Boolean(a != b),
(a, b) => panic!(
"Comparison operator != on mismatched types {:?} and {:?}",
&a, &b
a, b
),
}
}
Expand Down
Loading