provide read_term_from_chars/2 (#334)

This commit is contained in:
Mark Thom
2020-04-12 17:26:11 -06:00
parent 7621155a89
commit d3a9392421
6 changed files with 147 additions and 63 deletions

View File

@@ -145,7 +145,8 @@ impl DomainError for Number {
}
impl MachineError {
pub(super) fn functor_stub(name: ClauseName, arity: usize) -> MachineStub {
pub(super)
fn functor_stub(name: ClauseName, arity: usize) -> MachineStub {
functor!(
"/",
SharedOpDesc::new(400, YFX),
@@ -153,7 +154,8 @@ impl MachineError {
)
}
pub(super) fn evaluation_error(eval_error: EvalError) -> Self {
pub(super)
fn evaluation_error(eval_error: EvalError) -> Self {
let stub = functor!("evaluation_error", [atom(eval_error.as_str())]);
MachineError {
@@ -313,6 +315,20 @@ impl MachineError {
}
}
pub(super)
fn uninstantiation_error(culprit: Addr) -> Self {
let stub = functor!(
"uninstantiation_error",
[addr(culprit)]
);
MachineError {
stub,
location: None,
from: ErrorProvenance::Received,
}
}
pub(super)
fn session_error(h: usize, err: SessionError) -> Self {
match err {