Skip to content

Commit 0d2c6bb

Browse files
committed
Add test for issue #3170 curly brace priority limit
Test verifies: - Priority 1200 operators in curly braces error correctly - Priority 1199 operators in curly braces work - Parenthesized priority 1200 operators work J.J.'s Robot
1 parent ee90296 commit 0d2c6bb

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Issue #3170: Enforce priority 1199 limit in curly braces
2+
3+
## Test that priority 1200 operator in curly braces throws syntax error
4+
5+
```trycmd
6+
$ scryer-prolog -f --no-add-history
7+
?- use_module(library(charsio)).
8+
true.
9+
?- op(1200,xfx,~>).
10+
true.
11+
?- read_from_chars("{a~>b}.",T).
12+
error(syntax_error(incomplete_reduction),read_term_from_chars/3:0).
13+
?- halt.
14+
```
15+
16+
## Test that priority 1199 operator in curly braces works
17+
18+
```trycmd
19+
$ scryer-prolog -f --no-add-history
20+
?- use_module(library(charsio)).
21+
true.
22+
?- op(1199,xfx,~>).
23+
true.
24+
?- read_from_chars("{a~>b}.",T).
25+
T = {a~>b}.
26+
?- halt.
27+
```
28+
29+
## Test that parenthesized priority 1200 operator in curly braces works
30+
31+
```trycmd
32+
$ scryer-prolog -f --no-add-history
33+
?- use_module(library(charsio)).
34+
true.
35+
?- op(1200,xfx,~>).
36+
true.
37+
?- read_from_chars("{(a~>b)}.",T).
38+
T = {a~>b}.
39+
?- halt.
40+
```

0 commit comments

Comments
 (0)