Fix compiler bug; Rewrite CI workflow
This commit is contained in:
parent
0aee607961
commit
1f62391b58
14
.github/workflows/rust.yml
vendored
14
.github/workflows/rust.yml
vendored
@ -1,21 +1,19 @@
|
|||||||
name: Dust Tests
|
name: Cargo Build & Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main"]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main"]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build_and_test:
|
||||||
|
name: Dust Build & Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- run: rustup update nightly && rustup default nightly
|
||||||
run: cargo build --verbose
|
- run: cargo build --verbose
|
||||||
- name: Run tests
|
- run: cargo test --verbose --no-fail-fast
|
||||||
run: cargo test --verbose
|
|
||||||
|
@ -1116,12 +1116,20 @@ impl<'src> Compiler<'src> {
|
|||||||
self.emit_instruction(test, Type::None, operator_position);
|
self.emit_instruction(test, Type::None, operator_position);
|
||||||
self.emit_instruction(jump, Type::None, operator_position);
|
self.emit_instruction(jump, Type::None, operator_position);
|
||||||
|
|
||||||
|
let instruction_count_before_right = self.instructions.len();
|
||||||
|
|
||||||
self.advance()?;
|
self.advance()?;
|
||||||
self.parse_sub_expression(&rule.precedence)?;
|
self.parse_sub_expression(&rule.precedence)?;
|
||||||
|
|
||||||
// TODO: Check if the right type is boolean
|
// TODO: Check if the right type is boolean
|
||||||
|
|
||||||
if matches!(
|
if self.instructions.len() == instruction_count_before_right + 1 {
|
||||||
|
self.instructions
|
||||||
|
.last_mut()
|
||||||
|
.unwrap()
|
||||||
|
.0
|
||||||
|
.set_a_field(left.index());
|
||||||
|
} else if matches!(
|
||||||
self.get_last_operations(),
|
self.get_last_operations(),
|
||||||
Some([
|
Some([
|
||||||
Operation::EQUAL | Operation::LESS | Operation::LESS_EQUAL,
|
Operation::EQUAL | Operation::LESS | Operation::LESS_EQUAL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user