From: Mark Thom Date: Tue, 2 Apr 2019 05:08:03 +0000 (-0600) Subject: pass more conformity tests X-Git-Tag: v0.8.110~127 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=98f9027b2e1ac293b3c0b757f9f3a718430e5795;p=scryer-prolog.git pass more conformity tests --- diff --git a/Cargo.toml b/Cargo.toml index 5a10a986..4ef3bccf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scryer-prolog" -version = "0.8.36" +version = "0.8.37" authors = ["Mark Thom "] repository = "https://github.com/mthom/scryer-prolog" description = "A modern Prolog implementation written mostly in Rust." diff --git a/src/prolog/lib/builtins.pl b/src/prolog/lib/builtins.pl index 7357d230..24711315 100644 --- a/src/prolog/lib/builtins.pl +++ b/src/prolog/lib/builtins.pl @@ -738,9 +738,10 @@ op_specifier(OpSpec) :- atom(OpSpec), ). op_specifier(OpSpec) :- throw(error(type_error(atom, OpSpec), op/3)). -valid_op(Op) :- atom(Op), +valid_op(Op) :- atom(Op), ( Op == (,) -> throw(error(permission_error(modify, operator, (,)), op/3)) % 8.14.3.3 j), k). - ; Op == '|' -> throw(error(permission_error(create, operator, (|)), op/3)) % www.complang.tuwien.ac.at/ulrich/iso-prolog/conformity_testing#72 + ; Op == {} -> throw(error(permission_error(create, operator, {}), op/3)) + ; Op == [] -> throw(error(permission_error(create, operator, []), op/3)) ; true ). @@ -750,6 +751,10 @@ op(Priority, OpSpec, Op) :- ( var(Priority) -> throw(error(instantiation_error, op/3)) % 8.14.3.3 a) ; var(OpSpec) -> throw(error(instantiation_error, op/3)) % 8.14.3.3 b) ; var(Op) -> throw(error(instantiation_error, op/3)) % 8.14.3.3 c) + ; Op == '|' -> ( op_priority(Priority), op_specifier(OpSpec), + lists:member(OpSpec, [xfx, xfy, yfx]), Priority >= 1001 + -> '$op'(Priority, OpSpec, Op) + ; throw(error(permission_error(create, operator, (|)), op/3))) % www.complang.tuwien.ac.at/ulrich/iso-prolog/conformity_testing#72 ; valid_op(Op), op_priority(Priority), op_specifier(OpSpec) -> '$op'(Priority, OpSpec, Op) ; list_of_op_atoms(Op), op_priority(Priority), op_specifier(OpSpec) ->