Skip to content

Commit

Permalink
Merge pull request #2495 from Skgland/fix2467
Browse files Browse the repository at this point in the history
fix looping from issue #2467
  • Loading branch information
mthom authored Aug 18, 2024
2 parents bacfed8 + c24a51b commit 3f25ee3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/toplevel.pl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@
%% Enable op declarations with lists of operands, i.e.,
%% :- op(900, fy, [$,@]).

user:term_expansion((:- op(Pred, Spec, [Op | OtherOps])), OpResults) :-
user:term_expansion((:- op(Pred, Spec, Ops)), OpResults) :-
ground(Ops),
Ops = [Op | OtherOps],
expand_op_list([Op | OtherOps], Pred, Spec, OpResults).

expand_op_list([], _, _, []).
Expand Down
1 change: 1 addition & 0 deletions tests-pl/invalid_decl_issue2467.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:- D.
21 changes: 15 additions & 6 deletions tests/scryer/cli/src_tests/directive_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ $ scryer-prolog -f --no-add-history tests-pl/invalid_decl10.pl -g halt
```

The following test doesn't appear to terminate so its moved to a block quote for now
FIXME I belive the following test should result in a `error(instantiation_error,load/1)` error instead of the current error.

> ```trycmd
> $ scryer-prolog -f --no-add-history tests-pl/invalid_decl11.pl -g halt
> % Warning: singleton variables Var at line 0 of invalid_decl11.pl
> error(instantiation_error,load/1).
> ```
```trycmd
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl11.pl -g halt
% Warning: singleton variables Var at line 0 of invalid_decl11.pl
error(type_error(list,todo_insert_invalid_term_here),load/1).
```

```trycmd
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl12.pl -g halt
Expand Down Expand Up @@ -96,3 +97,11 @@ $ scryer-prolog -f --no-add-history tests-pl/invalid_decl16.pl -g halt
error(permission_error(modify,operator,','),load/1).
```


```trycmd
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl_issue2467.pl -g halt
% Warning: singleton variables D at line 0 of invalid_decl_issue2467.pl
error(instantiation_error,load/1).
```

0 comments on commit 3f25ee3

Please sign in to comment.