Compiler & Verifier Diagnostics Reference (RSW700 – RSW715)
Every diagnostic emitted by raggiescript.exe check, raggiescript.exe lsp, instbuild.exe, and RaggieScript.Core carries a stable RSW7xx code, 1-based (line, column) coordinates, and actionable fix guidance.
Summary Table of All RaggieScript Diagnostics
| Code | Category | Phase | Summary |
|---|---|---|---|
RSW700 | Lexical / Syntax / Preprocessor | Parse | Unterminated string/comment, unexpected token, missing ; / }, or cyclic include. |
RSW701 | Wizard Phase Isolation | Binder | Mutating call (fs.write*, reg.write*, msi.install, svc.*, etc.) reached directly or transitively inside wizard { ... }. |
RSW702 | Capability Sandbox Violation | Binder | Sandboxed Studio profile (use training;, use a11y;, use localization;, use document;) attempted host OS/FS/Registry/Network access. |
RSW704 | Bytecode & SHA-256 Integrity | Loader | Invalid RSWBC2/RSWBC1 magic header, truncated stream, or 32-byte SHA-256 tamper mismatch! |
RSW710 | Undeclared Identifier | Type Binder | Variable, ref target, or function name is not in scope (includes Levenshtein "Did you mean '...'?" hint). |
RSW711 | Static Type Mismatch | Type Binder | Incompatible initializer, assignment, struct field type, match arm pattern, or return value type. |
RSW712 | Call Arity or Unknown Method | Type Binder | Unknown ns.method() (with fuzzy suggestion) or wrong argument count/type passed to a function. |
RSW713 | Immutability Violation | Type Binder / VM | Reassigning a const binding, passing a const variable as ref, or mutating a CLI hard-locked KEY:VALUE parameter. |
RSW714 | Unknown struct Field or enum Variant | Type Binder | Typo in MyStruct { badField: 1 } or MyEnum.BadVariant (includes fuzzy field/variant suggestion). |
RSW715 | Control-Flow Violation | Type Binder | Non-void typed fn missing a return along a code path, or break; / continue; outside a loop. |
Detailed Diagnostic Guides & Fixes
RSW701 — Wizard Phase Isolation Violation
Why it happens: wizard { ... } (and any helper fn called from wizard) must remain 100% read-only so canceling the wizard leaves zero trace on the PC and Uac.Deferred can run the wizard un-elevated.
// FAILS WITH RSW701:
wizard {
step Welcome {
reg.writeString(Hive.HKCU, r"Software\App", "VisitedWizard", "1"); // <-- RSW701!
}
}
// FIX: Bind a 'param' in wizard, and write to the Registry inside 'install { ... }'!
param optedIn: bool = true;
wizard {
step Welcome { ui.checkbox(text: "Save preference", bind: ref optedIn); }
}
install {
if (optedIn) { reg.writeString(Hive.HKCU, r"Software\App", "OptedIn", "1"); }
}
RSW702 — Capability Sandbox Violation
Why it happens: Scripts running inside SCORM web courses (use training;) or compliance linters (use a11y;) are isolated from host OS I/O. Remove fs.*/reg.*/net.* calls or switch to use installer; for native setup tools.
RSW704 — Bytecode SHA-256 Tamper Rejection
Why it happens: Every compiled .rswbc file and #225 PE resource embeds a 32-byte bcrypt.dll SHA-256 digest over the entire constant pool and instruction stream. Any single flipped bit halts LoadRaggieScriptBytecode before a single instruction executes.
RSW710 & RSW714 — Undeclared Symbol / Unknown Field (Fuzzy Suggestions)
param installDir: path = sys.programFiles / "Demo";
install {
fs.mkdir(instalDir);
// -> [RSW710] Undeclared identifier 'instalDir'. Did you mean 'installDir'?
}
RSW711, RSW712, RSW713 & RSW715 — Type, Arity, const & Return Checks
const lockedPort: int = 8443;
// ui.textBox(label: "Port:", bind: ref lockedPort);
// -> [RSW713] Cannot pass immutable 'const' binding 'lockedPort' by 'ref'. Use 'param' or 'let'!
fn computePort(useTls: bool) : int {
if (useTls) { return 443; }
// -> [RSW715] Function 'computePort()' declares return type 'int' but not all control paths return a value.
return 8080;
}
RSW700 (Syntax / Preprocessor Error)Diagnostic
RSW701 (Wizard Phase Isolation)Diagnostic
RSW702 (Capability Sandbox Violation)Diagnostic
RSW704 (Bytecode SHA-256 Tamper Gate)Diagnostic
RSW710 (Undeclared Identifier)Diagnostic
RSW711 (Static Type Mismatch)Diagnostic
RSW712 (Arity / Unknown Method)Diagnostic
RSW713 (Immutability / CLI Lock Violation)Diagnostic
RSW714 (Unknown Struct Field / Enum Variant)Diagnostic
RSW715 (Missing Return / Loop Control)Diagnostic