fix: escape sequences in strings, --version/--help, manifest parser, debug cleanup
- Lexer (Nim + Bux): resolve escape sequences (\n, \t, \r, etc) instead of keeping raw source text in token. This was the root cause of \n being double-escaped to \\n in generated C code. - Manifest parser (src_bux/manifest.bux): use bux_strlen instead of broken String_SplitCount(s, "") hack for string length; fix quote stripping. - CLI (src_bux/cli.bux): --version/--help now recognized alongside version/help. - Remove ~30+ debug Print statements from cli, parser, lexer, sema, main. - Clean up unneeded Print/PrintInt extern declarations. - _selfhost/src/: synced from src_bux/.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// Parses package metadata: name, version, type, build output.
|
||||
module Manifest {
|
||||
|
||||
extern func bux_strlen(s: String) -> uint;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Manifest struct
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -56,9 +58,10 @@ func Manifest_Parse(content: String) -> Manifest {
|
||||
// Strip quotes from value
|
||||
var val: String = rawVal;
|
||||
if String_StartsWith(val, "\"") && String_EndsWith(val, "\"") {
|
||||
let len: uint = String_SplitCount(val, ""); // dummy to get length indirectly
|
||||
// Simple strip: just use the string between quotes
|
||||
val = String_Slice(rawVal, 1, String_SplitCount(rawVal, "") as uint - 2);
|
||||
let vlen: uint = bux_strlen(val);
|
||||
if vlen >= 2 {
|
||||
val = String_Slice(val, 1, vlen - 2);
|
||||
}
|
||||
}
|
||||
|
||||
if String_Eq(currentSection, "Package") {
|
||||
|
||||
Reference in New Issue
Block a user