fix: JS const _ duplication and hardcoded version string

- JS backend now emits wildcard let bindings as side-effect statements
  instead of const _ declarations, fixing SyntaxError on multiple let _ = ...
- Version string now uses env!("CARGO_PKG_VERSION") to auto-sync with Cargo.toml
- Add -lm linker flag for math library support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 23:05:03 -05:00
parent 61e1469845
commit b56c5461f1
2 changed files with 47 additions and 26 deletions

View File

@@ -37,7 +37,7 @@ use std::borrow::Cow;
use std::collections::HashSet;
use typechecker::TypeChecker;
const VERSION: &str = "0.1.0";
const VERSION: &str = env!("CARGO_PKG_VERSION");
const HELP: &str = r#"
Lux - A functional language with first-class effects
@@ -902,6 +902,7 @@ fn compile_to_c(path: &str, output_path: Option<&str>, run_after: bool, emit_c:
.args(["-O2", "-o"])
.arg(&output_bin)
.arg(&temp_c)
.arg("-lm")
.output();
match compile_result {