-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpascal-comments.demo.xq
64 lines (60 loc) · 2.06 KB
/
pascal-comments.demo.xq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import module namespace aparecium
= "http://blackmesatech.com/2019/iXML/Aparecium"
at "../build/Aparecium.xqm";
let $g := doc('pascal-comments.sp.ixml.compiled.xml')/ixml
let $demo := <demo>
<p>This is a small demo of using ixml from inside an interactive XQuery
interface.</p>
<p>Evaluate this query to see the result of parsing the test input below
using the given grammar. Edit the grammar and test input and re-evaluate
to see the effects of your changes.</p>
<div>
<p>SP's positive test cases:</p>
<test-input>(**)</test-input>
<test-input>(***)</test-input>
<test-input>(****)</test-input>
<test-input>(*****)</test-input>
<test-input>(*abc*)</test-input>
<test-input>(**abc*)</test-input>
<test-input>(*abc**)</test-input>
<test-input>(*abc*abc*)</test-input>
<test-input>(**abc*abc*)</test-input>
<test-input>(*abc**abc*)</test-input>
<test-input>(*abc*abc**)</test-input>
<test-input>(*abc* )(*abc*)</test-input>
<test-input>(*abc*)(*abc*)</test-input>
</div>
<div>
<p>MSM's additional positive test cases:</p>
<!--* (**) is a duplicate *-->
<!--* (***) is a duplicate *-->
<!--* (****) is a duplicate *-->
<test-input>(***a*)</test-input>
<test-input>(**a*)</test-input>
<test-input>(**a*a*)</test-input>
<test-input>(**aa*)</test-input>
<test-input>(*a*)</test-input>
</div>
<div>
<p>MSM's negative test cases:</p>
<test-input>(</test-input>
<test-input>(*</test-input>
<test-input>(**</test-input>
<test-input>(***</test-input>
<test-input>(**a</test-input>
<test-input>(**a*</test-input>
<test-input>(**aa</test-input>
<test-input>(*a</test-input>
<test-input>(*a*</test-input>
<test-input>(*aa</test-input>
<test-input>a</test-input>
<test-input>)</test-input>
<test-input>*)</test-input>
<test-input>**)</test-input>
</div>
</demo>
return <results>{
for $i in $demo//test-input/string()
let $o := aparecium:parse-string-with-compiled-grammar($i, $g)
return <test input="{$i}">{$o}</test>
}</results>