From: Mark Thom Date: Sat, 5 Mar 2022 18:14:24 +0000 (-0700) Subject: use must_be(chars) in read_from_chars/2 (#1305) X-Git-Tag: v0.9.0^2~1 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=de35baadf360ef46813750b2c8ecdfeaae13bafa;p=scryer-prolog.git use must_be(chars) in read_from_chars/2 (#1305) --- diff --git a/src/lib/charsio.pl b/src/lib/charsio.pl index 33e6e422..4ac7df2b 100644 --- a/src/lib/charsio.pl +++ b/src/lib/charsio.pl @@ -114,17 +114,7 @@ get_single_char(C) :- read_from_chars(Chars, Term) :- - ( var(Chars) -> - instantiation_error(read_from_chars/2) - ; nonvar(Term) -> - throw(error(uninstantiation_error(Term), read_from_chars/2)) - ; '$skip_max_list'(_, _, Chars, Chars0), - Chars0 == [], - partial_string(Chars) -> - true - ; - type_error(complete_string, Chars, read_from_chars/2) - ), + must_be(chars, Chars), '$read_term_from_chars'(Chars, Term).