feat(value,ir): ref.ambiguous error, exact conversion helpers and mixed builtin calls

- value: add ErrorCategory::RefAmbiguous (code ref.ambiguous) for the S-07 rule
  that a reference matching several resources must never silently pick the
  first one; re-export float/integer conversion helpers at the crate root.
- ir/builtins: math/foreign calls accept positional arguments followed by named
  ones (matching the documented examples) instead of being named-only; arity
  and unknown-name validation still apply.
- tests updated for the new builtin call shape.
This commit is contained in:
cflmy committed 2026-11-20 10:43:50 +08:00
1 parent 8003907f4e
commit 46c9ca2fd3
3 files changed
+18 -10

No files matched your search

+4
View File
@@ -35,6 +35,9 @@ pub enum ErrorCategory {
MathUnsupported,
/// Plugin ABI negotiation failed.
PluginAbi,
/// A resource reference matches more than one resource (S-07: never pick
/// the first silently).
RefAmbiguous,
/// A plugin reported an execution failure.
PluginFailure,
/// A foreign kernel failed (non-zero exit, protocol violation).
@@ -62,6 +65,7 @@ impl ErrorCategory {
ErrorCategory::KernelUnavailable => codes::KERNEL_UNAVAILABLE,
ErrorCategory::MathUnsupported => codes::MATH_UNSUPPORTED,
ErrorCategory::PluginAbi => codes::PLUGIN_ABI_MISMATCH,
ErrorCategory::RefAmbiguous => "ref.ambiguous",
ErrorCategory::PluginFailure => "plugin.failure",
ErrorCategory::ForeignFailure => "foreign.failure",
ErrorCategory::HostError => "host.error",
+4 -1
View File
@@ -13,5 +13,8 @@ pub mod wire;
pub use diagnostic::{codes, Diagnostic, Related, Severity};
pub use error::{CallFrame, ErrorCategory, RuntimeError};
pub use marqdo_span::{LineCol, Span};
pub use value::{CodeValue, FormulaValue, FunctionRef, Table, Value};
pub use value::{
bigint_to_exact_f64, float_to_bigint, format_float, CodeValue, FormulaValue, FunctionRef,
Table, Value,
};
pub use wire::{from_wire, to_wire, WireError, WIRE_VERSION};