fix(cold-eval): hoist make_synth_error_at out of the synth-only guard (firmware profile uses it for sink sugar)
This commit is contained in:
parent
e1a2e0115c
commit
120eb0bb45
1 changed files with 25 additions and 23 deletions
|
|
@ -1111,6 +1111,31 @@ static EvalResult do_nudge_time(TokenStream& ts, EngineState& state) {
|
||||||
return make_ok();
|
return make_ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generic positioned-error constructor (used by synth declarations AND the
|
||||||
|
// vector-packed sink sugar — must compile under every build profile).
|
||||||
|
static EvalResult make_synth_error_at(uint16_t span_start, uint16_t span_len,
|
||||||
|
DiagnosticCategory cat,
|
||||||
|
const char* message,
|
||||||
|
const char* suggestion = nullptr) {
|
||||||
|
EvalResult r;
|
||||||
|
r.kind = EvalResult::Error;
|
||||||
|
if (r.diagnostic_count < 8) {
|
||||||
|
r.diagnostics[r.diagnostic_count++] = {
|
||||||
|
DiagnosticSeverity::Error, cat,
|
||||||
|
span_start, span_len, message, suggestion
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
static EvalResult make_synth_error_at(const Token& tok,
|
||||||
|
DiagnosticCategory cat,
|
||||||
|
const char* message,
|
||||||
|
const char* suggestion = nullptr) {
|
||||||
|
return make_synth_error_at(tok.span_start, tok.span_len, cat,
|
||||||
|
message, suggestion);
|
||||||
|
}
|
||||||
|
|
||||||
#if USEQ_HAS_SYNTH_ENGINE
|
#if USEQ_HAS_SYNTH_ENGINE
|
||||||
// ── Host synth declaration (synth-nodes.md §3) ─────────────────────────────
|
// ── Host synth declaration (synth-nodes.md §3) ─────────────────────────────
|
||||||
//
|
//
|
||||||
|
|
@ -1151,29 +1176,6 @@ static const char* strdup_safe(const char* s) {
|
||||||
return slot;
|
return slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
static EvalResult make_synth_error_at(uint16_t span_start, uint16_t span_len,
|
|
||||||
DiagnosticCategory cat,
|
|
||||||
const char* message,
|
|
||||||
const char* suggestion = nullptr) {
|
|
||||||
EvalResult r;
|
|
||||||
r.kind = EvalResult::Error;
|
|
||||||
if (r.diagnostic_count < 8) {
|
|
||||||
r.diagnostics[r.diagnostic_count++] = {
|
|
||||||
DiagnosticSeverity::Error, cat,
|
|
||||||
span_start, span_len, message, suggestion
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
static EvalResult make_synth_error_at(const Token& tok,
|
|
||||||
DiagnosticCategory cat,
|
|
||||||
const char* message,
|
|
||||||
const char* suggestion = nullptr) {
|
|
||||||
return make_synth_error_at(tok.span_start, tok.span_len, cat,
|
|
||||||
message, suggestion);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resolve a NodeDef by name+version, with precise diagnostics for each
|
// Resolve a NodeDef by name+version, with precise diagnostics for each
|
||||||
// failure mode (VAL-COMP-005).
|
// failure mode (VAL-COMP-005).
|
||||||
static const NodeDefDescriptor* resolve_nodedef(
|
static const NodeDefDescriptor* resolve_nodedef(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue