pub enum CompileError {
Parse(Diagnostics),
PremiseRedefinition {
name: String,
},
MissingDomain {
file: String,
},
DuplicateDomain {
file: String,
},
UnknownDomain {
domain: String,
},
DomainAliasClash {
alias: String,
},
ImportNotFound(String),
CircularImport(String),
RuleDisjunctiveConsequent {
name: String,
},
UnknownValue(Box<UnknownValue>),
}Expand description
Anything that can go wrong while compiling (and resolving imports).
Variants§
Parse(Diagnostics)
A source failed to parse; carries the full syntax diagnostics (every
error, each as a caret block with the keyword’s correct syntax). The
source label is already inside the Diagnostics header.
PremiseRedefinition
A name was reused with a different body within the same source.
MissingDomain
A source did not declare its DOMAIN (required, once, as the first
statement).
DuplicateDomain
A source declared DOMAIN more than once (a file has exactly one domain).
UnknownDomain
An atom referenced a domain. prefix that is not the file’s own domain and
was not imported in this file.
DomainAliasClash
Two imports bound the same local domain name to different domains (use a
distinct AS <alias> to tell them apart).
ImportNotFound(String)
An IMPORT target could not be loaded by the Resolver.
CircularImport(String)
Imports form a cycle (a source transitively imports itself).
RuleDisjunctiveConsequent
A RULE used OR in its THEN: forward chaining cannot derive a
disjunction (it would not know which literal to assert). Model it as a
PREMISE constraint instead.
UnknownValue(Box<UnknownValue>)
A reference used a value outside the closed set an ONEOF declared for that
variable. Almost always a typo: the misspelling would otherwise mint a new
atom that hangs in the air as UNKNOWN. Closed-world is opt-in — it only
applies to a (subject, predicate) whose values an ONEOF enumerated.
Boxed so this comparatively large payload does not bloat every Result.
Trait Implementations§
Source§impl Debug for CompileError
impl Debug for CompileError
Source§impl Display for CompileError
impl Display for CompileError
impl Eq for CompileError
Source§impl Error for CompileError
impl Error for CompileError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for CompileError
impl PartialEq for CompileError
Source§fn eq(&self, other: &CompileError) -> bool
fn eq(&self, other: &CompileError) -> bool
self and other values to be equal, and is used by ==.