summaryrefslogtreecommitdiff
path: root/testdata/integration
diff options
context:
space:
mode:
Diffstat (limited to 'testdata/integration')
-rw-r--r--testdata/integration/user_defined_syntax/math_non_greedy_limits.in.osml5
-rw-r--r--testdata/integration/user_defined_syntax/math_non_greedy_limits.out.osxml28
-rw-r--r--testdata/integration/user_defined_syntax/non_greedy_shortform.in.osml2
-rw-r--r--testdata/integration/user_defined_syntax/non_greedy_shortform.out.osxml15
-rw-r--r--testdata/integration/user_defined_syntax/ontologies/math.osml8
-rw-r--r--testdata/integration/user_defined_syntax/ontologies/non_greedy_shortform.osml15
6 files changed, 69 insertions, 4 deletions
diff --git a/testdata/integration/user_defined_syntax/math_non_greedy_limits.in.osml b/testdata/integration/user_defined_syntax/math_non_greedy_limits.in.osml
new file mode 100644
index 0000000..d9481d0
--- /dev/null
+++ b/testdata/integration/user_defined_syntax/math_non_greedy_limits.in.osml
@@ -0,0 +1,5 @@
+\document
+\import[ontology]{./ontologies/math}
+\begin{math}
+ \sum_{i=3}^{5} i_M^2
+\end{math}
diff --git a/testdata/integration/user_defined_syntax/math_non_greedy_limits.out.osxml b/testdata/integration/user_defined_syntax/math_non_greedy_limits.out.osxml
new file mode 100644
index 0000000..86f38b1
--- /dev/null
+++ b/testdata/integration/user_defined_syntax/math_non_greedy_limits.out.osxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document xmlns:math="math">
+ <math:math>
+ <math:equation>
+ <math:field>
+ <math:sum>
+ <math:limits>
+ <math:lowerLimit>
+ <math:text>i</math:text>
+ <math:equals/>
+ <math:number>3</math:number>
+ </math:lowerLimit>
+ <math:upperLimit>
+ <math:number>5</math:number>
+ </math:upperLimit>
+ </math:limits>
+ </math:sum>
+ <math:text>i</math:text>
+ <math:index>
+ <math:text>M</math:text>
+ </math:index>
+ <math:power>
+ <math:number>2</math:number>
+ </math:power>
+ </math:field>
+ </math:equation>
+ </math:math>
+</document>
diff --git a/testdata/integration/user_defined_syntax/non_greedy_shortform.in.osml b/testdata/integration/user_defined_syntax/non_greedy_shortform.in.osml
new file mode 100644
index 0000000..68866c6
--- /dev/null
+++ b/testdata/integration/user_defined_syntax/non_greedy_shortform.in.osml
@@ -0,0 +1,2 @@
+\import[ontology]{./ontologies/non_greedy_shortform}
+\begin{test}?a ?b?c ??d + ?+{?} \end{test}
diff --git a/testdata/integration/user_defined_syntax/non_greedy_shortform.out.osxml b/testdata/integration/user_defined_syntax/non_greedy_shortform.out.osxml
new file mode 100644
index 0000000..c2431eb
--- /dev/null
+++ b/testdata/integration/user_defined_syntax/non_greedy_shortform.out.osxml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document xmlns:test="test">
+ <test:test>
+ <test:a>a</test:a>
+ <test:a>b</test:a>
+ <test:a>c</test:a>
+ <test:a/>
+ <test:a>d</test:a>
+ <test:b/>
+ <test:a/>
+ <test:b>
+ <test:a/>
+ </test:b>
+ </test:test>
+</document>
diff --git a/testdata/integration/user_defined_syntax/ontologies/math.osml b/testdata/integration/user_defined_syntax/ontologies/math.osml
index c864d2b..f10b6a2 100644
--- a/testdata/integration/user_defined_syntax/ontologies/math.osml
+++ b/testdata/integration/user_defined_syntax/ontologies/math.osml
@@ -76,12 +76,12 @@
% TODO: Differentiate between lower and upper index vs. power operator?
\struct#power[isa=primitive]
\syntax
- \short{^}
+ \short[greedy=false]{^}
\field
\childRef[ref=primitive]
\struct#index[isa=primitive]
\syntax
- \short{_}
+ \short[greedy=false]{_}
\field
\childRef[ref=primitive]
@@ -211,12 +211,12 @@
\childRef[ref=upperLimit]
\struct#lowerLimit[cardinality={0,1}]
\syntax
- \short{_}
+ \short[greedy=false]{_}
\field
\childRef[ref=primitive]
\struct#upperLimit[cardinality={0,1}]
\syntax
- \short{^}
+ \short[greedy=false]{^}
\field
\childRef[ref=primitive]
diff --git a/testdata/integration/user_defined_syntax/ontologies/non_greedy_shortform.osml b/testdata/integration/user_defined_syntax/ontologies/non_greedy_shortform.osml
new file mode 100644
index 0000000..7a370ac
--- /dev/null
+++ b/testdata/integration/user_defined_syntax/ontologies/non_greedy_shortform.osml
@@ -0,0 +1,15 @@
+\ontology#test
+ \struct#test[root=true]
+ \field
+ \childRef[a]
+ \childRef[b]
+ \struct#a
+ \syntax
+ \short[false]{?}
+ \primitive[optional=true,type=string]
+ \struct#b
+ \syntax
+ \short[false]{+}
+ \field
+ \childRef[a]
+