fix: remove legacy bnf

This commit is contained in:
2026-03-12 22:24:52 -07:00
parent 31a6c8b91b
commit 944326f114
8 changed files with 46 additions and 1997 deletions

View File

@@ -1,7 +1,7 @@
//! Integration tests for the compiler binary against the Hello World program.
//!
//! These tests exercise the full compilation pipeline:
//! hello.rpg → BNF validation → AST lowering → LLVM codegen → native binary
//! hello.rpg → recursive-descent parser → AST lowering → LLVM codegen → native binary
use std::process::Command;
@@ -71,7 +71,7 @@ fn hello_rpg_produces_output_file() {
}
/// The compiler must print the file name to stderr with an "ok:" prefix when
/// BNF validation succeeds.
/// compilation succeeds.
#[test]
fn hello_rpg_reports_ok_on_stderr() {
let out_path = std::env::temp_dir().join("hello_rpg_reports_ok.out");
@@ -121,33 +121,6 @@ fn hello_rpg_emit_ir() {
);
}
/// `--emit-tree` must print the BNF parse tree to stdout and exit 0.
///
/// The tree must mention `program` (the top-level grammar rule).
#[test]
fn hello_rpg_emit_tree() {
let out = run(&["--emit-tree", HELLO_RPG]);
assert!(
out.status.success(),
"expected exit 0 with --emit-tree\nstderr: {}",
String::from_utf8_lossy(&out.stderr),
);
let tree = String::from_utf8_lossy(&out.stdout);
assert!(
!tree.trim().is_empty(),
"--emit-tree output is empty — expected a parse tree",
);
assert!(
tree.contains("program"),
"--emit-tree output should reference the <program> rule\n{}",
&tree[..tree.len().min(1000)],
);
}
/// `--no-link` should produce a `.o` object file and exit 0.
#[test]
fn hello_rpg_no_link_produces_object() {