From 3734e7048e718ec641c17006a21a1a86ceeac6f1 Mon Sep 17 00:00:00 2001 From: Paulo Moura Date: Sat, 11 Sep 2021 10:01:00 +0100 Subject: [PATCH] Add uninstantiation_error/1 implementation --- docs/index_status.html | 2 +- src/docs/content.index_status.template | 2 +- src/engine/foreign.js | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/index_status.html b/docs/index_status.html index 8e7bbbf..cc83e1d 100644 --- a/docs/index_status.html +++ b/docs/index_status.html @@ -478,7 +478,7 @@

7.12.2 Error classification

  • resource_error. [not implemented]
  • syntax_error.
  • system_error. [not implemented]
  • -
  • uninstantiation_error. [not implemented]
  • +
  • uninstantiation_error.
  • diff --git a/src/docs/content.index_status.template b/src/docs/content.index_status.template index 17ed954..01d8b97 100644 --- a/src/docs/content.index_status.template +++ b/src/docs/content.index_status.template @@ -117,7 +117,7 @@ The ProscriptLS aspiration includes implementing most of ISO Prolog and some add
  • resource_error. [not implemented]
  • syntax_error.
  • system_error. [not implemented]
  • -
  • uninstantiation_error. [not implemented]
  • +
  • uninstantiation_error.
  • diff --git a/src/engine/foreign.js b/src/engine/foreign.js index 5b206c2..82b4e4b 100644 --- a/src/engine/foreign.js +++ b/src/engine/foreign.js @@ -3655,6 +3655,15 @@ function instantiation_error(v) return predicate_throw(ref); } +function uninstantiation_error(got) +{ + var ftor = lookup_functor('uninstantiation_error', 1); + var ref = state.H ^ (TAG_STR << WORD_BITS); + memory[state.H++] = ftor; + memory[state.H++] = lookup_atom(got); + return predicate_throw(ref); +} + function domain_error(domain, got) { var ftor = lookup_functor('domain_error', 2); @@ -3663,7 +3672,6 @@ function domain_error(domain, got) memory[state.H++] = lookup_atom(domain); memory[state.H++] = got; return predicate_throw(ref); - } function format_error(message)