Problem is, even if somebody scraps the test cases
from your web site. Every time you change it or
extend it, he has to scrap again.
So what would be easier, would be a Prolog primary
single source. I guess you also generate the table
automatically from some Prolog facts, and
running your tests. So if these Prolog facts
that represent the tests would be available,
this could safe a lot of work,
and nowadays pushing content to GitHub etc.. is
very easy. Well I guess it can be scrapped with
XML and/or XPath and/or XSL.
Scraping it just like that from the browser
gives the following, but I guess it needs
encoding to turn it into Prolog facts:
1 writeq('\n').
2 '
3 )
261 )
'
4 .
5 writeq(' '). % horiz. tab
177 0'\t=0' . % horiz. tab
6 writeq('
').
7 writeq('\
'). % "\\\n"
8 writeq('\
a'). % "\\\na"
9 writeq('a\
b'). % "a\\\nb"
10 writeq('a\
b'). % "a\\\n b"
11 writeq('\ ').
193 writeq('\
'). % "\\ \n"
12 writeq('\ '). % "\\\t"
13 writeq('\t').
14 writeq('\a').
15 writeq('\7\').
16 writeq('\ca').
241 writeq('\d').
17 writeq('\e').
18 writeq('\033\').
19 char_code('\e',C).
21 char_code('\d',C).
22 writeq('\u1').
23 X = 0'\u1.
24 writeq('
25 writeq(.
26 '\
''.
210 X = 0'\.
211 X = 0'\. .
222 writeq((-)-(-)).
223 writeq(((:-):-(:-))).
27 writeq((*)=(*)).
28 writeq([:-,-]).
29 writeq(f(*)).
30 writeq(a*(b+c)).
31 writeq(f(;,'|',';;')).
32 writeq([.,.(.,.,.)]).
33 writeq((a :- b,c)).
34 write_canonical([a]).
35 writeq('/*').
203 writeq(//*).
282 writeq(//*.*/).
36 writeq('/**').
37 writeq('*/').
38 "\'\`\"" = "'`""". % "
179 "\'\"" = "'""". % "
178 "\`" = "`".
39 '\'\`\"' = '''`"'.
40 writeq('\'\`\"\"').
41 ('\\') = (\).
42 op(1,xf,xf1).
1xf1 = xf1(1).
43 X = 0X1.
44 float(.0).
45 op(100,xfx,.).
functor(3 .2,F,A).
46 float(- .0).
47 float(1E9).
48 integer(1e).
49 op(9,xf,e9).
1e9 = e9(1).
50 op(9,xf,e).
1e-9 = -(e(1),9).
51 /**/ 1.0e- 9 = -(e(1.0),9).
204 /**/ writeq(1e).
220 /**/ writeq(1.0e).
52 op(9,xfy,e).
1.2e 3 = e(X,Y).
53 writeq(1.0e100).
54 float(1.0ee9).
286 (- (1)) = -(1).
287 (- -1) = -(-1).
288 (- 1^2) = ^(-1,2).
56 integer(- 1).
57 integer('-'1).
58 integer('-' 1).
59 integer(- /*.*/1).
60 integer(-/*.*/1).
61 integer('-'/*.*/1).
62 atom(-/*.*/-).
63 op(0,fy,-).
180 /**/ integer(-1).
64 /**/ integer(- 1).
135 writeq(-(1)).
136 op(0,fy,-),writeq(-(1)).
182 writeq(-(-1)).
183 writeq(-(1^2)).
260 writeq(-(a^2)).
139 writeq(-((a,b))).
218 writeq(-(1*2)).
140 writeq(-a).
184 writeq(-(-)).
185 writeq(-[-]).
188 writeq(-p(c)).
189 writeq(-{}).
190 writeq(-{a}).
191 writeq(-(-a)).
192 writeq(-(-(-a))).
216 writeq(-(-(1))).
215 op(100,yfx,~).
writeq(-(1~2~3)).
248 /**/ writeq(- (1~2)).
249 /**/ writeq(1~2).
278 op(9,xfy,.), writeq(-[1]).
279 op(9,xf,'$VAR'), writeq(- '$VAR'(0)).
55 op(1,yf,yf1).
{-1 yf1}={yf1(X)}.
65 compound(+1).
66 compound(+ 1).
277 writeq(+1^2).
257 writeq([+{a},+[]]).
67 op(0,fy,+).
compound(+1).
68 [(:-)|(:-)]=[:-|:-].
69 X=[a|b,c].
70 op(1000,xfy,',').
71 op(1001,xfy,',').
72 op(999,xfy,'|').
73 /**/ X=[a|b].
285 /**/ X=[(a|b)].
219 /**/ [a|[]]=[a].
74 /**/ X=[a|b|c].
75 var(a:-b).
76 :- = :- .
77 - = - .
78 * = * .
79 current_op(200,fy,-).
80 current_op(200,fy,+).
81 {- - c}={-(-(c))}.
82 (- -) = -(-).
83 (- - -) = -(-(-)).
84 (- - - -) = -(-(-(-))).
85 {:- :- c} = {:-(:-,c)}.
86 {- = - 1}={(-(=)) - 1}.
87 write_canonical((- = - 1)).
88 write_canonical((- = -1)).
89 write_canonical((-;)).
90 write_canonical((-;-)).
91 write_canonical((:-;-)).
92 [:- -c] = [(:- -c)].
93 writeq([a,b|,]).
94 X ={,}.
95 {1} = {}(1).
96 write_canonical({1}).
97 '[]'(1) = [ ](X).
98 X = [] (1).
99 op(100,yfy,op).
100 '''' = '\''.
101 a = '\141\'.
102 a = '\141'.
103 X = '\141\141'.
104 X = '\9'.
105 X = '\N'.
106 X = '\\' .
107 X = '\77777777777\'.
108 a = '\x61\'.
109 atom_codes('\xG\',Cs).
110 atom_codes('\xG1\',Cs).
111 atom(`).
112 atom(`+).
113 X = `a`.
114 integer(0'\').
115 integer(0''').
116 0''' = 0'\'.
117 integer(0'').
195 op(100,xf,'').
205 /**/ (0 '') = ''(X).
196 /**/ writeq(0 '').
197 /**/ writeq(0'').
118 op(100,xfx,'').
119 /**/ functor(0 ''1, F, A).
120 /**/ functor(0''1, F, A).
206 op(100,xf,f).
writeq(0'f').
207 /**/ writeq(0'f'f').
209 /**/ writeq(0'ff).
256 /**/ writeq(0f).
208 op(100,xf,'f ').
writeq(0 'f ').
121 X = 2'1.
122 op(100,xfx,'1').
functor(2'1'y, F, A).
262 /**/ functor(2 '1'y, F, A).
123 X =0'\x41\ .
124 X =0'\x41\.
125 X =0'\x1\.
127 X is 16'mod'2.
128 X is 37'mod'2.
129 X is 0'mod'1.
130 X is 1'+'1.
212 X is 1'\
+'1.
213 X is 0'\
+'1.
259 X = 0'\
+'/*'. %*/1.
214 X is 0'\
126 X = 0'\
.\
131 op(100,fx,' op').
132 /**/ writeq(' op' '1').
133 /**/ writeq(' op'[]).
134 op(1,xf,xf1).
writeq({- =xf1}).
137 writeq(- (a*b)).
138 writeq(\ (a*b)).
141 current_op(P,xfy,.).
142 op(100,xfy,.).
143 /**/ writeq(1 .2).
144 /**/ writeq([1]).
283 /**/ writeq(-[1]).
221 /**/ X = 1.e.
258 /**/ writeq(ok).%
1 = X.
145 write_canonical('$VAR'(0)).
146 write_term('$VAR'(0),[]).
244 writeq('$VAR'(0)).
245 writeq('$VAR'(-1)).
246 writeq('$VAR'(-2)).
247 writeq('$VAR'(x)).
289 writeq('$VAR'('A')).
147 op(9,fy,fy),op(9,yf,yf).
write_canonical(fy 1 yf).
148 /**/ write_canonical(fy yf).
149 /**/ writeq(fy(yf(1))).
150 /**/ writeq(yf(fy(1))).
151 op(9,fy,fy),op(9,yfx,yfx).
write_canonical(fy 1 yfx 2).
152 /**/ writeq(fy(yfx(1,2))).
153 /**/ writeq(yfx(fy(1),2)).
154 op(9,yf,yf),op(9,xfy,xfy).
write_canonical(1 xfy 2 yf).
155 /**/ writeq(xfy(1,yf(2))).
156 /**/ writeq(yf(xfy(1,2))).
157 op(0,xfy,:-).
current_op(P,xfx,:-).
158 op(0,xfy,',').
159 op(9,fy,f),op(9,yf,f).
write_canonical(f f 0).
201 /**/ writeq(f(f(0))).
202 /**/ write_canonical(f 0 f).
160 /**/ write_canonical(0 f f).
161 /**/ write_canonical(f f).
162 op(9,fy,p),op(9,yfx,p).
write_canonical(1 p p p 2).
163 op(9,fy,p),op(9,xfy,p).
write_canonical(1 p p p 2).
164 op(7,fy,p),op(9,yfx,p).
write_canonical(1 p p p 2).
165 atom('.''-''.').
166 op(0,xfy,'|').
167 /**/ writeq((a|b)).
168 op(0,xfy,.),op(9,yf,.).
169 /**/ writeq(.(.)).
194 op(0,xfy,.),writeq((.)+(.)).
170 set_prolog_flag(
double_quotes,chars).
171 /**/ writeq("a").
229 /**/ writeq("\z").
172 X is 10.0** -323, writeq(X).
173 1.0e-323=:=10.0** -323.
174 -1 = -0x1.
175 T = t(0b1,0o1,0x1).
176 X is 0b1mod 2.
217 op(1105,xfy,'|').
181 /**/ writeq((a-->b,c|d)).
290 /**/ writeq([(a|b)]).
186 X/* /*/=7.
187 X/*/*/=7.
198 atom($-).
199 atom(-$).
200 op(900, fy, [$]).
write_canonical($a+b).
224 \ .
225 char_code(C,0), writeq(C).
250 writeq('\0\').
226 write_canonical(_+_).
227 write_canonical(B+B).
228 writeq(0'\z).
230 char_code('\^',X).
231 writeq(0'\c).
232 writeq(0'\ ).
233 writeq(nop (1)).
234 op(400,fx,f).
writeq(f/*.*/(1,2)).
235 /**/ writeq(1 = f).
236 write_canonical(a- - -b).
237 op(699,xf,>).
238 /**/ writeq(>(>(a),b)).
239 /**/ write_canonical(a> >b).
242 /**/ write_canonical(a> =b).
243 /**/ write_canonical((a>,b)).
240 /**/ write_canonical(a>).
251 op(9,yfx,[bop,bo,b,op,xor]).
writeq(0bop 2).
263 /**/ writeq(0 bop 2).
252 /**/ writeq(0bo 2).
253 /**/ writeq(0b 2).
254 /**/ writeq(0op 2).
255 /**/ writeq(0xor 2).
264 writeq('^`').
265 op(9,yf,[b2,o8]).
266 /**/ writeq(0b2).
267 /**/ writeq(0o8).
268 op(500, xfy, {}).
269 writeq('\b\r\f\t\n').
270 get_char(C). %a
271 get_char(C).%a
272 writeq(0B1).
274 op(20,fx,--),writeq(--(a)).
275 /**/ op(0,fy,--),writeq(--(a)).
276 writeq(0xamod 2).
280 writeq(00'+'1).
281 writeq(00'a).
284 writeq('\^J').
291 Finis ().
But for testing, either use term_atom/2, or
with_input_from/2 and with_output_to/2, etc..
as a harness.