Some work on flow, mainly code tidy-up

This commit is contained in:
Simon Brooke 2023-07-11 09:15:56 +01:00
parent ca3861b505
commit fb39f1ee9c
36 changed files with 5191 additions and 3995 deletions

View file

@ -0,0 +1,40 @@
.covered {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: #558B55;
}
.not-covered {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: red;
}
.partial {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
background-color: orange;
}
.not-tracked {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
}
.blank {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
}
td {
padding-right: 10px;
}
td.with-bar {
width: 250px;
text-align: center;
}
td.with-number {
text-align: right;
}
td.ns-name {
min-width: 150px;
padding-right: 25px;
}

149
docs/cloverage/index.html Normal file
View file

@ -0,0 +1,149 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="./coverage.css"/>
<title>Coverage Summary</title>
</head>
<body>
<table>
<thead><tr>
<td class="ns-name"> Namespace </td>
<td class="with-bar"> Forms </td>
<td class="with-number">Forms %</td>
<td class="with-bar"> Lines </td>
<td class="with-number">Lines %</td>
<td class="with-number">Total</td><td class="with-number">Blank</td><td class="with-number">Instrumented</td>
</tr></thead>
<tr>
<td><a href="mw_parser/bulk.clj.html">mw-parser.bulk</a></td><td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 60 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-bar"><div class="covered"
style="width:100.0%;
float:left;"> 11 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-number">62</td><td class="with-number">7</td><td class="with-number">11</td>
</tr>
<tr>
<td><a href="mw_parser/core.clj.html">mw-parser.core</a></td><td class="with-bar"><div class="covered"
style="width:96.05475040257649%;
float:left;"> 1193 </div><div class="not-covered"
style="width:3.9452495974235107%;
float:left;"> 49 </div></td>
<td class="with-number">96.05 %</td>
<td class="with-bar"><div class="covered"
style="width:84.48979591836735%;
float:left;"> 207 </div><div class="partial"
style="width:14.285714285714286%;
float:left;"> 35 </div><div class="not-covered"
style="width:1.2244897959183674%;
float:left;"> 3 </div></td>
<td class="with-number">98.78 %</td>
<td class="with-number">451</td><td class="with-number">41</td><td class="with-number">245</td>
</tr>
<tr>
<td><a href="mw_parser/declarative.clj.html">mw-parser.declarative</a></td><td class="with-bar"><div class="covered"
style="width:93.29896907216495%;
float:left;"> 181 </div><div class="not-covered"
style="width:6.701030927835052%;
float:left;"> 13 </div></td>
<td class="with-number">93.30 %</td>
<td class="with-bar"><div class="covered"
style="width:91.66666666666667%;
float:left;"> 22 </div><div class="partial"
style="width:4.166666666666667%;
float:left;"> 1 </div><div class="not-covered"
style="width:4.166666666666667%;
float:left;"> 1 </div></td>
<td class="with-number">95.83 %</td>
<td class="with-number">157</td><td class="with-number">10</td><td class="with-number">24</td>
</tr>
<tr>
<td><a href="mw_parser/errors.clj.html">mw-parser.errors</a></td><td class="with-bar"><div class="covered"
style="width:90.4%;
float:left;"> 113 </div><div class="not-covered"
style="width:9.6%;
float:left;"> 12 </div></td>
<td class="with-number">90.40 %</td>
<td class="with-bar"><div class="covered"
style="width:90.47619047619048%;
float:left;"> 19 </div><div class="partial"
style="width:9.523809523809524%;
float:left;"> 2 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-number">68</td><td class="with-number">9</td><td class="with-number">21</td>
</tr>
<tr>
<td><a href="mw_parser/flow.clj.html">mw-parser.flow</a></td><td class="with-bar"><div class="covered"
style="width:89.1566265060241%;
float:left;"> 74 </div><div class="not-covered"
style="width:10.843373493975903%;
float:left;"> 9 </div></td>
<td class="with-number">89.16 %</td>
<td class="with-bar"><div class="covered"
style="width:85.71428571428571%;
float:left;"> 18 </div><div class="not-covered"
style="width:14.285714285714286%;
float:left;"> 3 </div></td>
<td class="with-number">85.71 %</td>
<td class="with-number">67</td><td class="with-number">5</td><td class="with-number">21</td>
</tr>
<tr>
<td><a href="mw_parser/generate.clj.html">mw-parser.generate</a></td><td class="with-bar"><div class="covered"
style="width:79.65179542981501%;
float:left;"> 732 </div><div class="not-covered"
style="width:20.348204570184983%;
float:left;"> 187 </div></td>
<td class="with-number">79.65 %</td>
<td class="with-bar"><div class="covered"
style="width:79.42857142857143%;
float:left;"> 139 </div><div class="partial"
style="width:3.4285714285714284%;
float:left;"> 6 </div><div class="not-covered"
style="width:17.142857142857142%;
float:left;"> 30 </div></td>
<td class="with-number">82.86 %</td>
<td class="with-number">318</td><td class="with-number">32</td><td class="with-number">175</td>
</tr>
<tr>
<td><a href="mw_parser/simplify.clj.html">mw-parser.simplify</a></td><td class="with-bar"><div class="covered"
style="width:79.12087912087912%;
float:left;"> 72 </div><div class="not-covered"
style="width:20.87912087912088%;
float:left;"> 19 </div></td>
<td class="with-number">79.12 %</td>
<td class="with-bar"><div class="covered"
style="width:76.0%;
float:left;"> 19 </div><div class="partial"
style="width:4.0%;
float:left;"> 1 </div><div class="not-covered"
style="width:20.0%;
float:left;"> 5 </div></td>
<td class="with-number">80.00 %</td>
<td class="with-number">84</td><td class="with-number">7</td><td class="with-number">25</td>
</tr>
<tr>
<td><a href="mw_parser/utils.clj.html">mw-parser.utils</a></td><td class="with-bar"><div class="covered"
style="width:93.58974358974359%;
float:left;"> 73 </div><div class="not-covered"
style="width:6.410256410256411%;
float:left;"> 5 </div></td>
<td class="with-number">93.59 %</td>
<td class="with-bar"><div class="covered"
style="width:90.0%;
float:left;"> 18 </div><div class="partial"
style="width:10.0%;
float:left;"> 2 </div></td>
<td class="with-number">100.00 %</td>
<td class="with-number">64</td><td class="with-number">10</td><td class="with-number">20</td>
</tr>
<tr><td>Totals:</td>
<td class="with-bar"></td>
<td class="with-number">89.47 %</td>
<td class="with-bar"></td>
<td class="with-number">92.25 %</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,194 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_parser/bulk.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;parse&nbsp;multiple&nbsp;rules&nbsp;from&nbsp;a&nbsp;stream,&nbsp;possibly&nbsp;a&nbsp;file.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-parser.bulk
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:use&nbsp;mw-parser.core
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mw-engine.utils
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clojure.java.io
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[clojure.string&nbsp;:only&nbsp;[split&nbsp;trim]])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;(:import&nbsp;(java.io&nbsp;BufferedReader&nbsp;StringReader)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
009&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;mw-parser:&nbsp;a&nbsp;rule&nbsp;parser&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
032&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
033&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
034&nbsp;&nbsp;(defn&nbsp;comment?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&quot;Is&nbsp;this&nbsp;`line`&nbsp;a&nbsp;comment?&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;[line]
</span><br/>
<span class="covered" title="15 out of 15 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;(or&nbsp;(empty?&nbsp;(trim&nbsp;line))&nbsp;(member?&nbsp;(first&nbsp;line)&nbsp;&#x27;(nil&nbsp;\#&nbsp;\;))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
038&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
039&nbsp;&nbsp;(defn&nbsp;parse-string
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&quot;Parse&nbsp;rules&nbsp;from&nbsp;successive&nbsp;lines&nbsp;in&nbsp;this&nbsp;`string`,&nbsp;assumed&nbsp;to&nbsp;have&nbsp;multiple
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lines&nbsp;delimited&nbsp;by&nbsp;the&nbsp;new-line&nbsp;character.&nbsp;Return&nbsp;a&nbsp;list&nbsp;of&nbsp;S-expressions.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;[string]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;tried&nbsp;to&nbsp;do&nbsp;this&nbsp;using&nbsp;with-open,&nbsp;but&nbsp;couldn&#x27;t&nbsp;make&nbsp;it&nbsp;work.
</span><br/>
<span class="covered" title="15 out of 15 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(parse-rule&nbsp;(trim&nbsp;%))&nbsp;(remove&nbsp;comment?&nbsp;(split&nbsp;string&nbsp;#&quot;\n&quot;))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
045&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
046&nbsp;&nbsp;(defn&nbsp;parse-file
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&quot;Parse&nbsp;rules&nbsp;from&nbsp;successive&nbsp;lines&nbsp;in&nbsp;the&nbsp;file&nbsp;loaded&nbsp;from&nbsp;this&nbsp;`filename`.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return&nbsp;a&nbsp;list&nbsp;of&nbsp;S-expressions.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;[filename]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;(parse-string&nbsp;(slurp&nbsp;filename)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
051&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
052&nbsp;&nbsp;(defn&nbsp;compile-string
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&quot;Compile&nbsp;each&nbsp;non-comment&nbsp;line&nbsp;of&nbsp;this&nbsp;`string`&nbsp;into&nbsp;an&nbsp;executable&nbsp;anonymous
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function,&nbsp;and&nbsp;return&nbsp;the&nbsp;sequence&nbsp;of&nbsp;such&nbsp;functions.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;[string]
</span><br/>
<span class="covered" title="14 out of 14 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;#(compile-rule&nbsp;%&nbsp;true)&nbsp;(remove&nbsp;comment?&nbsp;(split&nbsp;string&nbsp;#&quot;\n&quot;))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
057&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
058&nbsp;&nbsp;(defn&nbsp;compile-file
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&quot;Compile&nbsp;each&nbsp;non-comment&nbsp;line&nbsp;of&nbsp;the&nbsp;file&nbsp;indicated&nbsp;by&nbsp;this&nbsp;`filename`&nbsp;into
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;an&nbsp;executable&nbsp;anonymous&nbsp;function,&nbsp;and&nbsp;return&nbsp;the&nbsp;sequence&nbsp;of&nbsp;such&nbsp;functions.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;[filename]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;(compile-string&nbsp;(slurp&nbsp;filename)))
</span><br/>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,479 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_parser/declarative.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;A&nbsp;very&nbsp;simple&nbsp;parser&nbsp;which&nbsp;parses&nbsp;production&nbsp;rules.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;mw-parser.declarative
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[instaparse.core&nbsp;:refer&nbsp;[parser]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[clojure.string&nbsp;:refer&nbsp;[join&nbsp;trim]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.errors&nbsp;:refer&nbsp;[throw-parse-exception]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.generate&nbsp;:refer&nbsp;[generate]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.simplify&nbsp;:refer&nbsp;[simplify-rule]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.utils&nbsp;:refer&nbsp;[rule?]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[trptr.java-wrapper.locale&nbsp;:refer&nbsp;[get-default]])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;(:import&nbsp;[java.util&nbsp;Locale]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
012&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;mw-parser:&nbsp;a&nbsp;rule&nbsp;parser&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
035&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
036&nbsp;&nbsp;(def&nbsp;rule-grammar
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&quot;Basic&nbsp;rule&nbsp;language&nbsp;grammar.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;order&nbsp;to&nbsp;simplify&nbsp;translation&nbsp;into&nbsp;other&nbsp;natural&nbsp;languages,&nbsp;all
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;TOKENS&nbsp;within&nbsp;the&nbsp;parser&nbsp;should&nbsp;be&nbsp;unambiguou.&quot;
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;(join&nbsp;&quot;\n&quot;&nbsp;[&quot;RULE&nbsp;:=&nbsp;IF&nbsp;SPACE&nbsp;CONDITIONS&nbsp;SPACE&nbsp;THEN&nbsp;SPACE&nbsp;ACTIONS;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;ACTIONS&nbsp;:=&nbsp;ACTION&nbsp;|&nbsp;ACTION&nbsp;SPACE&nbsp;AND&nbsp;SPACE&nbsp;ACTIONS&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;ACTION&nbsp;:=&nbsp;SIMPLE-ACTION&nbsp;|&nbsp;PROBABLE-ACTION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;PROBABLE-ACTION&nbsp;:=&nbsp;VALUE&nbsp;SPACE&nbsp;CHANCE-IN&nbsp;SPACE&nbsp;VALUE&nbsp;SPACE&nbsp;SIMPLE-ACTION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;SIMPLE-ACTION&nbsp;:=&nbsp;SYMBOL&nbsp;SPACE&nbsp;BECOMES&nbsp;SPACE&nbsp;EXPRESSION;&quot;]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
046&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
047&nbsp;&nbsp;(def&nbsp;common-grammar
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&quot;Grammar&nbsp;rules&nbsp;used&nbsp;both&nbsp;in&nbsp;the&nbsp;rule&nbsp;grammar&nbsp;and&nbsp;in&nbsp;the&nbsp;flow&nbsp;grammar&quot;
</span><br/>
<span class="covered" title="30 out of 30 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;(join&nbsp;&quot;\n&quot;&nbsp;[&quot;COMPARATIVE&nbsp;:=&nbsp;MORE&nbsp;|&nbsp;LESS;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;COMPARATIVE-QUALIFIER&nbsp;:=&nbsp;IS&nbsp;SPACE&nbsp;COMPARATIVE&nbsp;SPACE&nbsp;THAN&nbsp;|&nbsp;COMPARATIVE&nbsp;SPACE&nbsp;THAN;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;CONDITION&nbsp;:=&nbsp;WITHIN-CONDITION&nbsp;|&nbsp;NEIGHBOURS-CONDITION&nbsp;|&nbsp;PROPERTY-CONDITION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;CONDITIONS&nbsp;:=&nbsp;DISJUNCT-CONDITION&nbsp;|&nbsp;CONJUNCT-CONDITION&nbsp;|&nbsp;CONDITION&nbsp;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;CONJUNCT-CONDITION&nbsp;:=&nbsp;CONDITION&nbsp;SPACE&nbsp;AND&nbsp;SPACE&nbsp;CONDITIONS;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;DISJUNCT-CONDITION&nbsp;:=&nbsp;CONDITION&nbsp;SPACE&nbsp;OR&nbsp;SPACE&nbsp;CONDITIONS;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;DISJUNCT-EXPRESSION&nbsp;:=&nbsp;IN&nbsp;SPACE&nbsp;DISJUNCT-VALUE;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;DISJUNCT-VALUE&nbsp;:=&nbsp;VALUE&nbsp;|&nbsp;VALUE&nbsp;SPACE&nbsp;OR&nbsp;SPACE&nbsp;DISJUNCT-VALUE;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;EQUIVALENCE&nbsp;:=&nbsp;IS&nbsp;SPACE&nbsp;EQUAL&nbsp;|&nbsp;EQUAL&nbsp;|&nbsp;IS&nbsp;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;EXPRESSION&nbsp;:=&nbsp;SIMPLE-EXPRESSION&nbsp;|&nbsp;RANGE-EXPRESSION&nbsp;|&nbsp;NUMERIC-EXPRESSION&nbsp;|&nbsp;DISJUNCT-EXPRESSION&nbsp;|&nbsp;VALUE;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;NEGATED-QUALIFIER&nbsp;:=&nbsp;QUALIFIER&nbsp;SPACE&nbsp;NOT&nbsp;|&nbsp;NOT&nbsp;SPACE&nbsp;QUALIFIER;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;NEIGHBOURS-CONDITION&nbsp;:=&nbsp;QUANTIFIER&nbsp;SPACE&nbsp;NEIGHBOURS&nbsp;SPACE&nbsp;IS&nbsp;SPACE&nbsp;PROPERTY-CONDITION&nbsp;|&nbsp;QUALIFIER&nbsp;SPACE&nbsp;NEIGHBOURS-CONDITION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;NUMBER&nbsp;:=&nbsp;#&#x27;[0-9]+&#x27;&nbsp;|&nbsp;#&#x27;[0-9]+.[0-9]+&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;NUMERIC-EXPRESSION&nbsp;:=&nbsp;VALUE&nbsp;|&nbsp;VALUE&nbsp;SPACE&nbsp;OPERATOR&nbsp;SPACE&nbsp;NUMERIC-EXPRESSION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;OPERATOR&nbsp;:=&nbsp;&#x27;+&#x27;&nbsp;|&nbsp;&#x27;-&#x27;&nbsp;|&nbsp;&#x27;*&#x27;&nbsp;|&nbsp;&#x27;&#x2F;&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;PROPERTY&nbsp;:=&nbsp;SYMBOL;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;PROPERTY-CONDITION&nbsp;:=&nbsp;PROPERTY&nbsp;SPACE&nbsp;QUALIFIER&nbsp;SPACE&nbsp;EXPRESSION&nbsp;|&nbsp;VALUE;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;PROPERTY-CONDITION-OR-EXPRESSION&nbsp;:=&nbsp;PROPERTY-CONDITION&nbsp;|&nbsp;EXPRESSION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;QUALIFIER&nbsp;:=&nbsp;COMPARATIVE-QUALIFIER&nbsp;|&nbsp;NEGATED-QUALIFIER&nbsp;|&nbsp;EQUIVALENCE&nbsp;|&nbsp;IS&nbsp;SPACE&nbsp;QUALIFIER;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;QUANTIFIER&nbsp;:=&nbsp;NUMBER&nbsp;|&nbsp;SOME&nbsp;|&nbsp;NONE&nbsp;|&nbsp;ALL&nbsp;|&nbsp;COMPARATIVE&nbsp;SPACE&nbsp;THAN&nbsp;SPACE&nbsp;NUMBER;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;RANGE-EXPRESSION&nbsp;:=&nbsp;BETWEEN&nbsp;SPACE&nbsp;NUMERIC-EXPRESSION&nbsp;SPACE&nbsp;AND&nbsp;SPACE&nbsp;NUMERIC-EXPRESSION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;SIMPLE-EXPRESSION&nbsp;:=&nbsp;QUALIFIER&nbsp;SPACE&nbsp;EXPRESSION&nbsp;|&nbsp;VALUE;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;SPACE&nbsp;:=&nbsp;#&#x27;\\s+&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;VALUE&nbsp;:=&nbsp;SYMBOL&nbsp;|&nbsp;NUMBER;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;VALUE&nbsp;:=&nbsp;SYMBOL&nbsp;|&nbsp;NUMBER;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;WITHIN-CONDITION&nbsp;:=&nbsp;QUANTIFIER&nbsp;SPACE&nbsp;NEIGHBOURS&nbsp;SPACE&nbsp;WITHIN&nbsp;SPACE&nbsp;NUMBER&nbsp;SPACE&nbsp;IS&nbsp;SPACE&nbsp;PROPERTY-CONDITION-OR-EXPRESSION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
076&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
077&nbsp;&nbsp;(def&nbsp;keywords-en
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&quot;English&nbsp;language&nbsp;keyword&nbsp;literals&nbsp;used&nbsp;in&nbsp;rules&nbsp;-&nbsp;both&nbsp;in&nbsp;production
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rules&nbsp;(this&nbsp;namespace)&nbsp;and&nbsp;in&nbsp;flow&nbsp;rules&nbsp;(see&nbsp;mw-parser.flow).
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It&#x27;s&nbsp;a&nbsp;long&nbsp;term&nbsp;aim&nbsp;that&nbsp;the&nbsp;rule&nbsp;language&nbsp;should&nbsp;be&nbsp;easy&nbsp;to&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;internationalise;&nbsp;this&nbsp;isn&#x27;t&nbsp;a&nbsp;full&nbsp;solution&nbsp;but&nbsp;it&#x27;s&nbsp;a&nbsp;step&nbsp;towards
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;solution.&quot;
</span><br/>
<span class="covered" title="32 out of 32 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;(join&nbsp;&quot;\n&quot;&nbsp;[&quot;ALL&nbsp;:=&nbsp;&#x27;all&#x27;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
085&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;AND&nbsp;:=&nbsp;&#x27;and&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;BECOMES&nbsp;:=&nbsp;&#x27;should&nbsp;be&#x27;&nbsp;|&nbsp;&#x27;becomes&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;BETWEEN&nbsp;:=&nbsp;&#x27;between&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;CHANCE-IN&nbsp;:=&nbsp;&#x27;chance&nbsp;in&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;EACH&nbsp;:=&nbsp;&#x27;each&#x27;&nbsp;|&nbsp;&#x27;every&#x27;&nbsp;|&nbsp;&#x27;all&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;EQUAL&nbsp;:=&nbsp;&#x27;equal&nbsp;to&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;FIRST&nbsp;:=&nbsp;&#x27;first&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;FLOW&nbsp;:=&nbsp;&#x27;flow&#x27;&nbsp;|&nbsp;&#x27;move&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;FROM&nbsp;:=&nbsp;&#x27;from&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;IF&nbsp;:=&nbsp;&#x27;if&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;IN&nbsp;:=&nbsp;&#x27;in&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;IS&nbsp;:=&nbsp;&#x27;is&#x27;&nbsp;|&nbsp;&#x27;are&#x27;&nbsp;|&nbsp;&#x27;have&#x27;&nbsp;|&nbsp;&#x27;has&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;LEAST&nbsp;:=&nbsp;&#x27;least&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;LESS&nbsp;:=&nbsp;&#x27;less&#x27;&nbsp;|&nbsp;&#x27;fewer&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;MORE&nbsp;:=&nbsp;&#x27;more&#x27;&nbsp;|&nbsp;&#x27;greater&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;MOST&nbsp;:=&nbsp;&#x27;most&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;NEIGHBOURS&nbsp;:=&nbsp;&#x27;neighbour&#x27;&nbsp;|&nbsp;&#x27;neighbor&#x27;&nbsp;|&nbsp;&#x27;neighbours&#x27;&nbsp;|&nbsp;&#x27;neighbors&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;NONE&nbsp;:=&nbsp;&#x27;no&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;NOT&nbsp;:=&nbsp;&#x27;not&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;OR&nbsp;:=&nbsp;&#x27;or&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;SOME&nbsp;:=&nbsp;&#x27;some&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;SYMBOL&nbsp;is&nbsp;in&nbsp;the&nbsp;per-language&nbsp;file&nbsp;so&nbsp;that&nbsp;languages&nbsp;that&nbsp;use
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;(e.g.)&nbsp;Cyrillic&nbsp;characters&nbsp;can&nbsp;change&nbsp;the&nbsp;definition.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;SYMBOL&nbsp;:=&nbsp;#&#x27;[a-z]+&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;THAN&nbsp;:=&nbsp;&#x27;than&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
110&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;THEN&nbsp;:=&nbsp;&#x27;then&#x27;;&quot;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TO&nbsp;:=&nbsp;&#x27;to&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;WITH&nbsp;:=&nbsp;&#x27;with&#x27;&nbsp;|&nbsp;&#x27;where&#x27;&nbsp;|&nbsp;&#x27;having&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;WITHIN&nbsp;:=&nbsp;&#x27;within&#x27;;&quot;]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
114&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
115&nbsp;&nbsp;(defn&nbsp;keywords-for-locale
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
116&nbsp;&nbsp;&nbsp;&nbsp;&quot;For&nbsp;now,&nbsp;just&nbsp;return&nbsp;`keywords-en`;&nbsp;plan&nbsp;is&nbsp;to&nbsp;have&nbsp;resource&nbsp;files&nbsp;of&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
117&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keywords&nbsp;for&nbsp;different&nbsp;languages&nbsp;in&nbsp;a&nbsp;resource&nbsp;directory,&nbsp;but&nbsp;that&nbsp;isn&#x27;t
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;done&nbsp;yet.&nbsp;It&#x27;s&nbsp;probably&nbsp;not&nbsp;going&nbsp;to&nbsp;work&nbsp;easily&nbsp;for&nbsp;languages&nbsp;that&nbsp;use
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-latin&nbsp;alphabets,&nbsp;anyway.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;([]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keywords-for-locale&nbsp;(get-default)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;([^Locale&nbsp;_locale]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keywords-en))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
124&nbsp;&nbsp;
</span><br/>
<span class="covered" title="58 out of 58 forms covered">
125&nbsp;&nbsp;(defmacro&nbsp;build-parser&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
126&nbsp;&nbsp;&nbsp;&nbsp;&quot;Compose&nbsp;this&nbsp;grammar&nbsp;fragment&nbsp;`g`&nbsp;with&nbsp;the&nbsp;common&nbsp;grammar&nbsp;fragments&nbsp;to&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make&nbsp;a&nbsp;complete&nbsp;grammar,&nbsp;and&nbsp;return&nbsp;a&nbsp;parser&nbsp;for&nbsp;that&nbsp;complete&nbsp;grammar.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;[g]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;`(parser&nbsp;(join&nbsp;&quot;\n&quot;&nbsp;[~g&nbsp;common-grammar&nbsp;(keywords-for-locale)])))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
130&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
131&nbsp;&nbsp;(def&nbsp;parse-rule
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
132&nbsp;&nbsp;&nbsp;&nbsp;&quot;Parse&nbsp;the&nbsp;argument,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;string&nbsp;in&nbsp;the&nbsp;correct&nbsp;syntax,&nbsp;and&nbsp;return&nbsp;a&nbsp;parse&nbsp;tree.&quot;
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
133&nbsp;&nbsp;&nbsp;&nbsp;(build-parser&nbsp;rule-grammar))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
134&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
135&nbsp;&nbsp;(defn&nbsp;compile-rule
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;&quot;Parse&nbsp;this&nbsp;`rule-text`,&nbsp;a&nbsp;string&nbsp;conforming&nbsp;to&nbsp;the&nbsp;grammar&nbsp;of&nbsp;MicroWorld&nbsp;rules,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;into&nbsp;Clojure&nbsp;source,&nbsp;and&nbsp;then&nbsp;compile&nbsp;it&nbsp;into&nbsp;an&nbsp;anonymous
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;object,&nbsp;getting&nbsp;round&nbsp;the&nbsp;problem&nbsp;of&nbsp;binding&nbsp;mw-engine.utils&nbsp;in
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;compiling&nbsp;environment.&nbsp;If&nbsp;`return-tuple?`&nbsp;is&nbsp;present&nbsp;and&nbsp;true,&nbsp;return
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
140&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;list&nbsp;comprising&nbsp;the&nbsp;anonymous&nbsp;function&nbsp;compiled,&nbsp;and&nbsp;the&nbsp;function&nbsp;from
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
141&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;it&nbsp;was&nbsp;compiled.
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
142&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
143&nbsp;&nbsp;&nbsp;&nbsp;Throws&nbsp;an&nbsp;exception&nbsp;if&nbsp;parsing&nbsp;fails.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
144&nbsp;&nbsp;&nbsp;&nbsp;([rule-text&nbsp;return-tuple?]
</span><br/>
<span class="partial" title="5 out of 14 forms covered">
145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert&nbsp;(string?&nbsp;rule-text))
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
146&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[rule&nbsp;(trim&nbsp;rule-text)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree&nbsp;(simplify-rule&nbsp;(parse-rule&nbsp;rule))
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;afn&nbsp;(if&nbsp;(rule?&nbsp;tree)&nbsp;(eval&nbsp;(generate&nbsp;tree))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
149&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;else
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw-parse-exception&nbsp;tree))]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;return-tuple?
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;afn&nbsp;rule)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;else
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;afn)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
155&nbsp;&nbsp;&nbsp;&nbsp;([rule-text]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(compile-rule&nbsp;rule-text&nbsp;false)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
157&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,212 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_parser/errors.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Display&nbsp;parse&nbsp;errors&nbsp;in&nbsp;a&nbsp;format&nbsp;which&nbsp;makes&nbsp;it&nbsp;easy&nbsp;for&nbsp;the&nbsp;user
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;see&nbsp;where&nbsp;the&nbsp;error&nbsp;occurred.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;mw-parser.errors)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
005&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
024&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
025&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;&nbsp;error&nbsp;thrown&nbsp;when&nbsp;an&nbsp;attempt&nbsp;is&nbsp;made&nbsp;to&nbsp;set&nbsp;a&nbsp;reserved&nbsp;property
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
027&nbsp;&nbsp;(def&nbsp;reserved-properties-error
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;properties&nbsp;&#x27;x&#x27;&nbsp;and&nbsp;&#x27;y&#x27;&nbsp;of&nbsp;a&nbsp;cell&nbsp;are&nbsp;reserved&nbsp;and&nbsp;should&nbsp;not&nbsp;be&nbsp;set&nbsp;in&nbsp;rule&nbsp;actions&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;;;&nbsp;error&nbsp;thrown&nbsp;when&nbsp;a&nbsp;rule&nbsp;cannot&nbsp;be&nbsp;parsed.&nbsp;Slots&nbsp;are&nbsp;for
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;&nbsp;(1)&nbsp;rule&nbsp;text
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;&nbsp;(2)&nbsp;cursor&nbsp;showing&nbsp;where&nbsp;in&nbsp;the&nbsp;rule&nbsp;text&nbsp;the&nbsp;error&nbsp;occurred
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;;;&nbsp;(3)&nbsp;the&nbsp;reason&nbsp;for&nbsp;the&nbsp;error
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
033&nbsp;&nbsp;(def&nbsp;bad-parse-error&nbsp;&quot;I&nbsp;did&nbsp;not&nbsp;understand:\n&nbsp;&nbsp;&#x27;%s&#x27;\n&nbsp;&nbsp;%s\n&nbsp;&nbsp;%s&quot;)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
034&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
035&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
036&nbsp;&nbsp;(defn-&nbsp;explain-parse-error-reason
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&quot;Attempt&nbsp;to&nbsp;explain&nbsp;the&nbsp;reason&nbsp;for&nbsp;the&nbsp;parse&nbsp;error.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;[reason]
</span><br/>
<span class="covered" title="17 out of 17 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;(str&nbsp;&quot;Expecting&nbsp;one&nbsp;of&nbsp;(&quot;&nbsp;(apply&nbsp;str&nbsp;(map&nbsp;#(str&nbsp;(:expecting&nbsp;%)&nbsp;&quot;&nbsp;&quot;)&nbsp;reason))&nbsp;&quot;)&quot;))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
040&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
041&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
042&nbsp;&nbsp;(defn-&nbsp;parser-error-to-map
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;[parser-error]
</span><br/>
<span class="covered" title="16 out of 16 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[m&nbsp;(reduce&nbsp;(fn&nbsp;[map&nbsp;item](merge&nbsp;map&nbsp;{(first&nbsp;item)(second&nbsp;item)}))&nbsp;{}&nbsp;parser-error)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reason&nbsp;(map
</span><br/>
<span class="covered" title="15 out of 15 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(reduce&nbsp;(fn&nbsp;[map&nbsp;item]&nbsp;(merge&nbsp;{(first&nbsp;item)&nbsp;(second&nbsp;item)}&nbsp;map))&nbsp;{}&nbsp;%)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:reason&nbsp;m))]
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(merge&nbsp;m&nbsp;{:reason&nbsp;reason})))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
049&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
050&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
051&nbsp;&nbsp;(defn&nbsp;throw-parse-exception
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&quot;Construct&nbsp;a&nbsp;helpful&nbsp;error&nbsp;message&nbsp;from&nbsp;this&nbsp;`parser-error`,&nbsp;and&nbsp;throw&nbsp;an&nbsp;exception&nbsp;with&nbsp;that&nbsp;message.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;&nbsp;&nbsp;[parser-error]
</span><br/>
<span class="partial" title="5 out of 16 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;(assert&nbsp;(coll?&nbsp;parser-error)&nbsp;&quot;Expected&nbsp;a&nbsp;paser&nbsp;error&nbsp;structure?&quot;)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;(let
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;the&nbsp;error&nbsp;structure&nbsp;is&nbsp;a&nbsp;list,&nbsp;such&nbsp;that&nbsp;each&nbsp;element&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;two&nbsp;items,&nbsp;and
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;the&nbsp;first&nbsp;element&nbsp;in&nbsp;each&nbsp;sublist&nbsp;is&nbsp;a&nbsp;keyword.&nbsp;Easier&nbsp;to&nbsp;work&nbsp;with&nbsp;it&nbsp;as&nbsp;a&nbsp;map
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error-map&nbsp;(parser-error-to-map&nbsp;parser-error)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text&nbsp;(:text&nbsp;error-map)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reason&nbsp;(explain-parse-error-reason&nbsp;(:reason&nbsp;error-map))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;rules&nbsp;have&nbsp;only&nbsp;one&nbsp;line,&nbsp;by&nbsp;definition;&nbsp;we&#x27;re&nbsp;interested&nbsp;in&nbsp;the&nbsp;column
</span><br/>
<span class="partial" title="7 out of 8 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;column&nbsp;(if&nbsp;(:column&nbsp;error-map)(:column&nbsp;error-map)&nbsp;0)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;create&nbsp;a&nbsp;cursor&nbsp;to&nbsp;point&nbsp;to&nbsp;that&nbsp;column
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cursor&nbsp;(apply&nbsp;str&nbsp;(reverse&nbsp;(conj&nbsp;(repeat&nbsp;column&nbsp;&quot;&nbsp;&quot;)&nbsp;&quot;^&quot;)))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;message&nbsp;(format&nbsp;bad-parse-error&nbsp;text&nbsp;cursor&nbsp;reason)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;message))))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,209 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_parser/flow.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;A&nbsp;very&nbsp;simple&nbsp;parser&nbsp;which&nbsp;parses&nbsp;flow&nbsp;rules.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;mw-parser.flow
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[clojure.string&nbsp;:refer&nbsp;[join]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.declarative&nbsp;:refer&nbsp;[build-parser]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.simplify&nbsp;:refer&nbsp;[simplify-second-of-two]]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
007&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
008&nbsp;&nbsp;(def&nbsp;flow-grammar
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;&nbsp;&nbsp;&quot;Grammar&nbsp;for&nbsp;flow&nbsp;rules.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;My&nbsp;initial&nbsp;conception&nbsp;of&nbsp;this&nbsp;would&nbsp;be&nbsp;that&nbsp;production&nbsp;rules&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if-then&nbsp;rules)&nbsp;and&nbsp;flow&nbsp;rules&nbsp;(flow-from-to&nbsp;rules)&nbsp;would&nbsp;be&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entirely&nbsp;separate,&nbsp;presented&nbsp;to&nbsp;the&nbsp;parser&nbsp;as&nbsp;separate&nbsp;text&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;files,&nbsp;and&nbsp;parsed&nbsp;and&nbsp;compiled&nbsp;by&nbsp;different&nbsp;chains&nbsp;of&nbsp;functions.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;appears&nbsp;not&nbsp;to&nbsp;be&nbsp;necessary.&nbsp;Flow&nbsp;rules&nbsp;are&nbsp;easy&nbsp;to&nbsp;parse
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;the&nbsp;same&nbsp;parser&nbsp;as&nbsp;production&nbsp;rules&nbsp;--&nbsp;a&nbsp;lot&nbsp;of&nbsp;the&nbsp;grammar&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;intentionally&nbsp;common&nbsp;--&nbsp;and&nbsp;the&nbsp;rules&nbsp;are&nbsp;easily&nbsp;discriminated
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;the&nbsp;compilation&nbsp;(&#x27;generate&#x27;)&nbsp;stage.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;basic&nbsp;rule&nbsp;I&nbsp;want&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;compile&nbsp;at&nbsp;this&nbsp;stage&nbsp;is&nbsp;the&nbsp;&#x27;mutual
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aid&#x27;&nbsp;rule:
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
023&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`flow&nbsp;1&nbsp;food&nbsp;from&nbsp;house&nbsp;having&nbsp;food&nbsp;&gt;&nbsp;1&nbsp;to&nbsp;house&nbsp;with&nbsp;least&nbsp;food&nbsp;within&nbsp;2`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;
</span><br/>
<span class="covered" title="16 out of 16 forms covered">
026&nbsp;&nbsp;&nbsp;&nbsp;(join&nbsp;&quot;\n&quot;&nbsp;[&quot;FLOW-RULE&nbsp;:=&nbsp;FLOW&nbsp;SPACE&nbsp;QUANTITY&nbsp;SPACE&nbsp;PROPERTY&nbsp;SPACE&nbsp;FROM&nbsp;SPACE&nbsp;SOURCE&nbsp;SPACE&nbsp;TO-HOW&nbsp;SPACE&nbsp;DESTINATION;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;PERCENTAGE&nbsp;:=&nbsp;NUMBER&nbsp;#&#x27;%&#x27;;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;QUANTITY&nbsp;:=&nbsp;PERCENTAGE&nbsp;|&nbsp;NUMBER&nbsp;|&nbsp;EXPRESSION&nbsp;|&nbsp;SOME;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;SOURCE&nbsp;:=&nbsp;STATE&nbsp;|&nbsp;STATE&nbsp;SPACE&nbsp;WITH&nbsp;SPACE&nbsp;CONDITIONS;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;DESTINATION&nbsp;:=&nbsp;STATE&nbsp;|&nbsp;STATE&nbsp;SPACE&nbsp;WITH&nbsp;SPACE&nbsp;FLOW-CONDITIONS&nbsp;|&nbsp;STATE&nbsp;SPACE&nbsp;WITHIN&nbsp;SPACE&nbsp;VALUE&nbsp;SPACE&nbsp;WITH&nbsp;SPACE&nbsp;FLOW-CONDITIONS;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;DETERMINER&nbsp;:=&nbsp;MOST&nbsp;|&nbsp;LEAST;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;DETERMINER-CONDITION&nbsp;:=&nbsp;DETERMINER&nbsp;SPACE&nbsp;PROPERTY&nbsp;|&nbsp;DETERMINER&nbsp;SPACE&nbsp;PROPERTY;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;FLOW-CONDITIONS&nbsp;:=&nbsp;DETERMINER-CONDITION&nbsp;|&nbsp;CONDITIONS&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;STATE&nbsp;:=&nbsp;SYMBOL;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TO-HOW&nbsp;:=&nbsp;TO&nbsp;|&nbsp;TO-EACH&nbsp;|&nbsp;TO-FIRST;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TO-EACH&nbsp;:=&nbsp;TO&nbsp;SPACE&nbsp;EACH&nbsp;|&nbsp;TO&nbsp;SPACE&nbsp;ALL;&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;TO-FIRST&nbsp;:=&nbsp;TO&nbsp;SPACE&nbsp;FIRST&quot;]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
038&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
039&nbsp;&nbsp;(def&nbsp;parse-flow
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;&quot;Parse&nbsp;the&nbsp;argument,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;string&nbsp;in&nbsp;the&nbsp;correct&nbsp;syntax,&nbsp;and&nbsp;return&nbsp;a&nbsp;parse&nbsp;tree.&quot;
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;(build-parser&nbsp;flow-grammar))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
042&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&nbsp;&nbsp;(defn&nbsp;simplify-flow
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(coll?&nbsp;tree)
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(first&nbsp;tree)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CONDITION&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CONDITIONS&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:DETERMINER&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:DETERMINER-CONDITION&nbsp;(simplify-determiner-condition&nbsp;tree)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:EXPRESSION&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:FLOW&nbsp;nil
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:FLOW-CONDITIONS&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROPERTY&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROPERTY-CONDITION-OR-EXPRESSION&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SPACE&nbsp;nil
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:QUANTITY&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:STATE&nbsp;(list&nbsp;:PROPERTY-CONDITION
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;:SYMBOL&nbsp;&quot;state&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;(:QUALIFIER
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:EQUIVALENCE
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(:IS&nbsp;&quot;is&quot;)))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;:EXPRESSION
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;:VALUE&nbsp;(second&nbsp;tree))))
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove&nbsp;nil?&nbsp;(map&nbsp;simplify-flow&nbsp;tree)))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
067&nbsp;&nbsp;
</span><br/>
</body>
</html>

View file

@ -0,0 +1,962 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_parser/generate.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Generate&nbsp;Clojure&nbsp;source&nbsp;from&nbsp;simplified&nbsp;parse&nbsp;trees.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;mw-parser.generate
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004&nbsp;&nbsp;&nbsp;&nbsp;(:require&nbsp;[mw-parser.utils&nbsp;:refer&nbsp;[assert-type&nbsp;TODO]]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[mw-parser.errors&nbsp;:as&nbsp;pe]))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
006&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
025&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
026&nbsp;&nbsp;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
027&nbsp;&nbsp;(declare&nbsp;generate&nbsp;generate-action)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
028&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
029&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
030&nbsp;&nbsp;(defn&nbsp;generate-rule
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;rule&nbsp;specification,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;rule&nbsp;as&nbsp;a&nbsp;function&nbsp;of&nbsp;two&nbsp;arguments.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:RULE)
</span><br/>
<span class="covered" title="19 out of 19 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;fn&nbsp;[&#x27;cell&nbsp;&#x27;world]&nbsp;(list&nbsp;&#x27;if&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;2))&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;3)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
036&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
037&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
038&nbsp;&nbsp;(defn&nbsp;generate-conditions
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;conditions&nbsp;clause,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:CONDITIONS)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;(generate&nbsp;(second&nbsp;tree)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
044&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
045&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
046&nbsp;&nbsp;(defn&nbsp;generate-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;condition&nbsp;clause,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:CONDITION)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;(generate&nbsp;(second&nbsp;tree)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
052&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
053&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
054&nbsp;&nbsp;(defn&nbsp;generate-conjunct-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
055&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;conjunct&nbsp;correct&nbsp;condition&nbsp;clause,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:CONJUNCT-CONDITION)
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;(cons&nbsp;&#x27;and&nbsp;(map&nbsp;generate&nbsp;(rest&nbsp;tree))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
060&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
061&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
062&nbsp;&nbsp;(defn&nbsp;generate-disjunct-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;disjunct&nbsp;condition&nbsp;clause,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:DISJUNCT-CONDITION)
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;(cons&nbsp;&#x27;or&nbsp;(map&nbsp;generate&nbsp;(rest&nbsp;tree))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
068&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
069&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
070&nbsp;&nbsp;(defn&nbsp;generate-ranged-property-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;property&nbsp;condition&nbsp;clause&nbsp;for
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;`property`&nbsp;where&nbsp;the&nbsp;`expression`&nbsp;is&nbsp;a&nbsp;numeric&nbsp;range,&nbsp;generate&nbsp;and&nbsp;return
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;[tree&nbsp;property&nbsp;expression]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:PROPERTY-CONDITION)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;(nth&nbsp;tree&nbsp;3)&nbsp;:RANGE-EXPRESSION)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
077&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[l1&nbsp;(generate&nbsp;(nth&nbsp;expression&nbsp;2))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
078&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;l2&nbsp;(generate&nbsp;(nth&nbsp;expression&nbsp;4))
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pv&nbsp;(list&nbsp;property&nbsp;&#x27;cell)]
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;let&nbsp;[&#x27;lower&nbsp;(list&nbsp;&#x27;min&nbsp;l1&nbsp;l2)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;upper&nbsp;(list&nbsp;&#x27;max&nbsp;l1&nbsp;l2)]
</span><br/>
<span class="covered" title="13 out of 13 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;and&nbsp;(list&nbsp;&#x27;&gt;=&nbsp;pv&nbsp;&#x27;lower)&nbsp;(list&nbsp;&#x27;&lt;=&nbsp;pv&nbsp;&#x27;upper)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
083&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
084&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
085&nbsp;&nbsp;(defn&nbsp;generate-disjunct-property-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
086&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;property&nbsp;condition&nbsp;clause
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
087&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;the&nbsp;expression&nbsp;is&nbsp;a&nbsp;a&nbsp;disjunction,&nbsp;generate&nbsp;and&nbsp;return
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
088&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
089&nbsp;&nbsp;&nbsp;&nbsp;TODO:&nbsp;this&nbsp;is&nbsp;definitely&nbsp;still&nbsp;wrong!&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
090&nbsp;&nbsp;&nbsp;&nbsp;([tree]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
091&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[property&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
092&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qualifier&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;2))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
093&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expression&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;3))]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
094&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-disjunct-property-condition&nbsp;tree&nbsp;property&nbsp;qualifier&nbsp;expression)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
095&nbsp;&nbsp;&nbsp;&nbsp;([_tree&nbsp;property&nbsp;qualifier&nbsp;expression]
</span><br/>
<span class="covered" title="14 out of 14 forms covered">
096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[e&nbsp;(list&nbsp;&#x27;some&nbsp;(list&nbsp;&#x27;fn&nbsp;[&#x27;i]&nbsp;&#x27;(=&nbsp;i&nbsp;value))&nbsp;(list&nbsp;&#x27;quote&nbsp;expression))]
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
097&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;let&nbsp;[&#x27;value&nbsp;(list&nbsp;property&nbsp;&#x27;cell)]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
098&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(=&nbsp;qualifier&nbsp;&#x27;=)&nbsp;e
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
099&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;not&nbsp;e))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
100&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
101&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
102&nbsp;&nbsp;(defn&nbsp;generate-property-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
103&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;property&nbsp;condition&nbsp;clause,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
104&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
105&nbsp;&nbsp;&nbsp;&nbsp;([tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:PROPERTY-CONDITION)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="15 out of 15 forms covered">
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(=&nbsp;(count&nbsp;tree)&nbsp;2)&nbsp;(=&nbsp;(first&nbsp;(second&nbsp;tree))&nbsp;:SYMBOL))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;it&#x27;s&nbsp;a&nbsp;shorthand&nbsp;for&nbsp;&#x27;state&nbsp;equal&nbsp;to&nbsp;symbol&#x27;.&nbsp;This&nbsp;should&nbsp;probably&nbsp;have
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
110&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;been&nbsp;handled&nbsp;in&nbsp;simplify...
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-property-condition
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROPERTY-CONDITION
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
114&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;(:SYMBOL&nbsp;&quot;state&quot;)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x27;(:QUALIFIER&nbsp;(:EQUIVALENCE&nbsp;(:EQUAL&nbsp;&quot;equal&nbsp;to&quot;)))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(second&nbsp;tree)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
117&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;otherwise...
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-property-condition&nbsp;tree&nbsp;(first&nbsp;(nth&nbsp;tree&nbsp;3)))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
119&nbsp;&nbsp;&nbsp;&nbsp;([tree&nbsp;expression-type]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:PROPERTY-CONDITION)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
121&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[property&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
122&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qualifier&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;2))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
123&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;3))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
124&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expression&nbsp;(cond
</span><br/>
<span class="covered" title="20 out of 20 forms covered">
125&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(not&nbsp;(=&nbsp;qualifier&nbsp;&#x27;=))&nbsp;(keyword?&nbsp;e))&nbsp;(list&nbsp;&#x27;or&nbsp;(list&nbsp;e&nbsp;&#x27;cell)&nbsp;e)
</span><br/>
<span class="covered" title="20 out of 20 forms covered">
126&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(not&nbsp;(=&nbsp;qualifier&nbsp;&#x27;not=))&nbsp;(keyword?&nbsp;e))&nbsp;(list&nbsp;&#x27;or&nbsp;(list&nbsp;e&nbsp;&#x27;cell)&nbsp;e)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else&nbsp;e)]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;expression-type
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:DISJUNCT-EXPRESSION&nbsp;(generate-disjunct-property-condition&nbsp;tree&nbsp;property&nbsp;qualifier&nbsp;expression)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:RANGE-EXPRESSION&nbsp;(generate-ranged-property-condition&nbsp;tree&nbsp;property&nbsp;expression)
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
131&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;qualifier&nbsp;(list&nbsp;property&nbsp;&#x27;cell)&nbsp;expression)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
132&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
133&nbsp;&nbsp;(defn&nbsp;generate-qualifier
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
134&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;qualifier,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
135&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
136&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
137&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
138&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(=&nbsp;(count&nbsp;tree)&nbsp;2)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
139&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
140&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;else
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;2))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
142&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
143&nbsp;&nbsp;(defn&nbsp;generate-simple-action
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
144&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;simple&nbsp;action,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
145&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
146&nbsp;&nbsp;&nbsp;&nbsp;([tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:SIMPLE-ACTION)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-simple-action&nbsp;tree&nbsp;[]))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
149&nbsp;&nbsp;&nbsp;&nbsp;([tree&nbsp;others]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:SIMPLE-ACTION)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[property&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expression&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;3))]
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(or&nbsp;(=&nbsp;property&nbsp;:x)&nbsp;(=&nbsp;property&nbsp;:y))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;pe&#x2F;reserved-properties-error))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;merge
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(empty?&nbsp;others)&nbsp;&#x27;cell
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;else
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate&nbsp;others))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
159&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{property&nbsp;expression})))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
160&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
161&nbsp;&nbsp;(defn&nbsp;generate-probable-action
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
162&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;probable&nbsp;action,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
163&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
164&nbsp;&nbsp;&nbsp;&nbsp;([tree]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
165&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:PROBABLE-ACTION)
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
166&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-probable-action&nbsp;tree&nbsp;[]))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
167&nbsp;&nbsp;&nbsp;&nbsp;([tree&nbsp;others]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
168&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:PROBABLE-ACTION)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
169&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
170&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[chances&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;1))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;total&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;2))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action&nbsp;(generate-action&nbsp;(nth&nbsp;tree&nbsp;3)&nbsp;others)]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
173&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;TODO:&nbsp;could&nbsp;almost&nbsp;certainly&nbsp;be&nbsp;done&nbsp;better&nbsp;with&nbsp;macro&nbsp;syntax
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;if
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;&lt;&nbsp;(list&nbsp;&#x27;rand&nbsp;total)&nbsp;chances)
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
176&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
177&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
178&nbsp;&nbsp;(defn&nbsp;generate-action
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
179&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;action,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
180&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
181&nbsp;&nbsp;&nbsp;&nbsp;[tree&nbsp;others]
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
182&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(first&nbsp;tree)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
183&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:ACTIONS&nbsp;(generate-action&nbsp;(first&nbsp;tree)&nbsp;others)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
184&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SIMPLE-ACTION&nbsp;(generate-simple-action&nbsp;tree&nbsp;others)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
185&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROBABLE-ACTION&nbsp;(generate-probable-action&nbsp;tree&nbsp;others)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
186&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;(str&nbsp;&quot;Not&nbsp;a&nbsp;known&nbsp;action&nbsp;type:&nbsp;&quot;&nbsp;(first&nbsp;tree))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
187&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
188&nbsp;&nbsp;(defn&nbsp;generate-multiple-actions
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
189&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;one&nbsp;or&nbsp;more&nbsp;syntactically&nbsp;correct&nbsp;actions,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
190&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
191&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
192&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:ACTIONS)
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
193&nbsp;&nbsp;&nbsp;&nbsp;(generate-action&nbsp;(first&nbsp;(rest&nbsp;tree))&nbsp;(second&nbsp;(rest&nbsp;tree))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
194&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
195&nbsp;&nbsp;(defn&nbsp;generate-disjunct-value
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
196&nbsp;&nbsp;&nbsp;&nbsp;&quot;Generate&nbsp;a&nbsp;disjunct&nbsp;value.&nbsp;Essentially&nbsp;what&nbsp;we&nbsp;need&nbsp;here&nbsp;is&nbsp;to&nbsp;generate&nbsp;a
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
197&nbsp;&nbsp;&nbsp;&nbsp;flat&nbsp;list&nbsp;of&nbsp;values,&nbsp;since&nbsp;the&nbsp;`member`&nbsp;has&nbsp;already&nbsp;been&nbsp;taken&nbsp;care&nbsp;of.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
198&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
199&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:DISJUNCT-VALUE)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
200&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(=&nbsp;(count&nbsp;tree)&nbsp;4)
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
201&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons&nbsp;(generate&nbsp;(second&nbsp;tree))&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;3)))
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
202&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;(generate&nbsp;(second&nbsp;tree)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
203&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
204&nbsp;&nbsp;(defn&nbsp;generate-numeric-expression
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
205&nbsp;&nbsp;&nbsp;&nbsp;&quot;From&nbsp;this&nbsp;`tree`,&nbsp;assumed&nbsp;to&nbsp;be&nbsp;a&nbsp;syntactically&nbsp;correct&nbsp;numeric&nbsp;expression,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
206&nbsp;&nbsp;&nbsp;&nbsp;generate&nbsp;and&nbsp;return&nbsp;the&nbsp;appropriate&nbsp;clojure&nbsp;fragment.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
207&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
208&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:NUMERIC-EXPRESSION)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
209&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(count&nbsp;tree)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
210&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;(let&nbsp;[[p&nbsp;operator&nbsp;expression]&nbsp;(rest&nbsp;tree)
</span><br/>
<span class="partial" title="8 out of 9 forms covered">
211&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;property&nbsp;(if&nbsp;(number?&nbsp;p)&nbsp;p&nbsp;(list&nbsp;p&nbsp;&#x27;cell))]
</span><br/>
<span class="covered" title="11 out of 11 forms covered">
212&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;(generate&nbsp;operator)&nbsp;(generate&nbsp;property)&nbsp;(generate&nbsp;expression)))
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
213&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(first&nbsp;(second&nbsp;tree))
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
214&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SYMBOL&nbsp;(list&nbsp;(keyword&nbsp;(second&nbsp;(second&nbsp;tree)))&nbsp;&#x27;cell)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
215&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate&nbsp;(second&nbsp;tree)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
216&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
217&nbsp;&nbsp;(defn&nbsp;generate-neighbours-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
218&nbsp;&nbsp;&nbsp;&nbsp;&quot;Generate&nbsp;code&nbsp;for&nbsp;a&nbsp;condition&nbsp;which&nbsp;refers&nbsp;to&nbsp;neighbours.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
219&nbsp;&nbsp;&nbsp;&nbsp;([tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
220&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:NEIGHBOURS-CONDITION)
</span><br/>
<span class="partial" title="7 out of 13 forms covered">
221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(first&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
222&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NUMBER&nbsp;(read-string&nbsp;(second&nbsp;(second&nbsp;tree)))
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
223&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:QUANTIFIER&nbsp;(generate-neighbours-condition&nbsp;tree&nbsp;(first&nbsp;(second&nbsp;(second&nbsp;tree))))
</span><br/>
<span class="covered" title="14 out of 14 forms covered">
224&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:QUALIFIER&nbsp;(cons&nbsp;(generate&nbsp;(second&nbsp;tree))&nbsp;(rest&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;2))))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
225&nbsp;&nbsp;&nbsp;&nbsp;([tree&nbsp;quantifier-type]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
226&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[quantifier&nbsp;(second&nbsp;tree)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
227&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pc&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;4))]
</span><br/>
<span class="partial" title="3 out of 9 forms covered">
228&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;quantifier-type
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
229&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NUMBER&nbsp;(generate-neighbours-condition&nbsp;&#x27;=&nbsp;(read-string&nbsp;(second&nbsp;(second&nbsp;quantifier)))&nbsp;pc&nbsp;1)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
230&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SOME&nbsp;(generate-neighbours-condition&nbsp;&#x27;&gt;&nbsp;0&nbsp;pc&nbsp;1)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
231&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:MORE&nbsp;(let&nbsp;[value&nbsp;(generate&nbsp;(nth&nbsp;quantifier&nbsp;3))]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
232&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-neighbours-condition&nbsp;&#x27;&gt;&nbsp;value&nbsp;pc&nbsp;1))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
233&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:LESS&nbsp;(let&nbsp;[value&nbsp;(generate&nbsp;(nth&nbsp;quantifier&nbsp;3))]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-neighbours-condition&nbsp;&#x27;&lt;&nbsp;value&nbsp;pc&nbsp;1)))))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
235&nbsp;&nbsp;&nbsp;&nbsp;([comp1&nbsp;quantity&nbsp;property-condition&nbsp;distance]
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;comp1
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
237&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;count
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;remove&nbsp;&#x27;false?
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
239&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;map&nbsp;(list&nbsp;&#x27;fn&nbsp;[&#x27;cell]&nbsp;property-condition)
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(list&nbsp;&#x27;mw-engine.utils&#x2F;get-neighbours&nbsp;&#x27;world&nbsp;&#x27;cell&nbsp;distance))))&nbsp;quantity))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
241&nbsp;&nbsp;&nbsp;&nbsp;([comp1&nbsp;quantity&nbsp;property-condition]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
242&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-neighbours-condition&nbsp;comp1&nbsp;quantity&nbsp;property-condition&nbsp;1)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
243&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
244&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
245&nbsp;&nbsp;(defn&nbsp;generate-within-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
246&nbsp;&nbsp;&nbsp;&nbsp;&quot;Generate&nbsp;code&nbsp;for&nbsp;a&nbsp;condition&nbsp;which&nbsp;refers&nbsp;to&nbsp;neighbours&nbsp;within&nbsp;a&nbsp;specified&nbsp;distance.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
247&nbsp;&nbsp;&nbsp;&nbsp;NOTE&nbsp;THAT&nbsp;there&#x27;s&nbsp;clearly&nbsp;masses&nbsp;of&nbsp;commonality&nbsp;between&nbsp;this&nbsp;and
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
248&nbsp;&nbsp;&nbsp;&nbsp;`generate-neighbours-condition`,&nbsp;and&nbsp;that&nbsp;some&nbsp;refactoring&nbsp;is&nbsp;almost&nbsp;certainly
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
249&nbsp;&nbsp;&nbsp;&nbsp;desirable.&nbsp;It&nbsp;may&nbsp;be&nbsp;that&nbsp;it&#x27;s&nbsp;better&nbsp;to&nbsp;simplify&nbsp;a&nbsp;`NEIGHBOURS-CONDITION`
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
250&nbsp;&nbsp;&nbsp;&nbsp;into&nbsp;a&nbsp;`WITHIN-CONDITION`&nbsp;in&nbsp;the&nbsp;simplification&nbsp;stage.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
251&nbsp;&nbsp;&nbsp;&nbsp;([tree]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
252&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:WITHIN-CONDITION)
</span><br/>
<span class="partial" title="7 out of 13 forms covered">
253&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(first&nbsp;(second&nbsp;tree))
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
254&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:QUANTIFIER&nbsp;(generate-within-condition&nbsp;tree&nbsp;(first&nbsp;(second&nbsp;(second&nbsp;tree))))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:QUALIFIER&nbsp;(TODO&nbsp;&quot;qualified&nbsp;within...&nbsp;help!&quot;)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
256&nbsp;&nbsp;&nbsp;&nbsp;([tree&nbsp;quantifier-type]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
257&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[quantifier&nbsp;(second&nbsp;tree)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
258&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;distance&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;4))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
259&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pc&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;6))]
</span><br/>
<span class="partial" title="3 out of 9 forms covered">
260&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;quantifier-type
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
261&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NUMBER&nbsp;(generate-neighbours-condition&nbsp;&#x27;=&nbsp;(read-string&nbsp;(second&nbsp;(second&nbsp;quantifier)))&nbsp;pc&nbsp;distance)
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
262&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SOME&nbsp;(generate-neighbours-condition&nbsp;&#x27;&gt;&nbsp;0&nbsp;pc&nbsp;distance)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
263&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:MORE&nbsp;(let&nbsp;[value&nbsp;(generate&nbsp;(nth&nbsp;quantifier&nbsp;3))]
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
264&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-neighbours-condition&nbsp;&#x27;&gt;&nbsp;value&nbsp;pc&nbsp;distance))
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
265&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:LESS&nbsp;(let&nbsp;[value&nbsp;(generate&nbsp;(nth&nbsp;quantifier&nbsp;3))]
</span><br/>
<span class="not-covered" title="0 out of 6 forms covered">
266&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(generate-neighbours-condition&nbsp;&#x27;&lt;&nbsp;value&nbsp;pc&nbsp;distance))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
267&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
268&nbsp;&nbsp;(defn&nbsp;generate-flow
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
269&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
270&nbsp;&nbsp;&nbsp;&nbsp;(assert-type&nbsp;tree&nbsp;:WITHIN-CONDITION))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
271&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
272&nbsp;&nbsp;(defn&nbsp;generate
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
273&nbsp;&nbsp;&nbsp;&nbsp;&quot;Generate&nbsp;code&nbsp;for&nbsp;this&nbsp;(fragment&nbsp;of&nbsp;a)&nbsp;parse&nbsp;tree&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
274&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
275&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
276&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(coll?&nbsp;tree)
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
277&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(first&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
278&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:ACTIONS&nbsp;(generate-multiple-actions&nbsp;tree)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
279&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:COMPARATIVE&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
280&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:COMPARATIVE-QUALIFIER&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
281&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CONDITION&nbsp;(generate-condition&nbsp;tree)
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
282&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CONDITIONS&nbsp;(generate-conditions&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
283&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CONJUNCT-CONDITION&nbsp;(generate-conjunct-condition&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
284&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:DISJUNCT-CONDITION&nbsp;(generate-disjunct-condition&nbsp;tree)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
285&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:DISJUNCT-EXPRESSION&nbsp;(generate&nbsp;(nth&nbsp;tree&nbsp;2))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
286&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:DISJUNCT-VALUE&nbsp;(generate-disjunct-value&nbsp;tree)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
287&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:EQUIVALENCE&nbsp;&#x27;=
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
288&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:EXPRESSION&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
289&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:FLOW-RULE&nbsp;(generate-flow&nbsp;tree)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
290&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:LESS&nbsp;&#x27;&lt;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
291&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:MORE&nbsp;&#x27;&gt;
</span><br/>
<span class="partial" title="8 out of 16 forms covered">
292&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NEGATED-QUALIFIER&nbsp;(case&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
293&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;&#x27;not=
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
294&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;&nbsp;&#x27;&lt;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
295&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&nbsp;&#x27;&gt;)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
296&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NEIGHBOURS-CONDITION&nbsp;(generate-neighbours-condition&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
297&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NUMERIC-EXPRESSION&nbsp;(generate-numeric-expression&nbsp;tree)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
298&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:NUMBER&nbsp;(read-string&nbsp;(second&nbsp;tree))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
299&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:OPERATOR&nbsp;(symbol&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
300&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROBABLE-ACTION&nbsp;(generate-probable-action&nbsp;tree)
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
301&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROPERTY&nbsp;(list&nbsp;(generate&nbsp;(second&nbsp;tree))&nbsp;&#x27;cell)&nbsp;;;&nbsp;dubious&nbsp;-&nbsp;may&nbsp;not&nbsp;be&nbsp;right
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
302&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROPERTY-CONDITION&nbsp;(generate-property-condition&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
303&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:QUALIFIER&nbsp;(generate-qualifier&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
304&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:RULE&nbsp;(generate-rule&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
305&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SIMPLE-ACTION&nbsp;(generate-simple-action&nbsp;tree)
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
306&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SYMBOL&nbsp;(keyword&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
307&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:VALUE&nbsp;(generate&nbsp;(second&nbsp;tree))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
308&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:WITHIN-CONDITION&nbsp;(generate-within-condition&nbsp;tree)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
309&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map&nbsp;generate&nbsp;tree))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
310&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
311&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
312&nbsp;&nbsp;;;;&nbsp;Flow&nbsp;rules.&nbsp;A&nbsp;flow&nbsp;rule&nbsp;DOES&nbsp;NOT&nbsp;return&nbsp;a&nbsp;modified&nbsp;world;&nbsp;instead,&nbsp;it&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
313&nbsp;&nbsp;;;;&nbsp;returns&nbsp;a&nbsp;PLAN&nbsp;to&nbsp;modify&nbsp;the&nbsp;world,&nbsp;in&nbsp;the&nbsp;form&nbsp;of&nbsp;a&nbsp;sequence&nbsp;of&nbsp;`flows`.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
314&nbsp;&nbsp;;;;&nbsp;It&nbsp;is&nbsp;only&nbsp;when&nbsp;the&nbsp;plan&nbsp;is&nbsp;executed&nbsp;that&nbsp;the&nbsp;world&nbsp;is&nbsp;modified.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
315&nbsp;&nbsp;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
316&nbsp;&nbsp;;;;&nbsp;so&nbsp;we&#x27;re&nbsp;looking&nbsp;at&nbsp;something&nbsp;like
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
317&nbsp;&nbsp;;;;&nbsp;(fn&nbsp;[cell&nbsp;world])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
318&nbsp;&nbsp;;;;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(=&nbsp;(:state&nbsp;cell)&nbsp;(or&nbsp;(:house&nbsp;cell)&nbsp;:house))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,260 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_parser/simplify.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Simplify&nbsp;a&nbsp;parse&nbsp;tree.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;mw-parser.simplify)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
004&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;;;&nbsp;mw-parser:&nbsp;a&nbsp;rule&nbsp;parser&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
027&nbsp;&nbsp;
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
028&nbsp;&nbsp;(declare&nbsp;simplify-flow&nbsp;simplify-rule)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
029&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;;;&nbsp;(defn&nbsp;simplify-qualifier
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&quot;Given&nbsp;that&nbsp;this&nbsp;`tree`&nbsp;fragment&nbsp;represents&nbsp;a&nbsp;qualifier,&nbsp;what
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;qualifier&nbsp;is&nbsp;that?&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
033&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
034&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;(cond
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
035&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(empty?&nbsp;tree)&nbsp;nil
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
036&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(coll?&nbsp;tree)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(#{:EQUIVALENCE&nbsp;:COMPARATIVE}&nbsp;(first&nbsp;tree)))&nbsp;tree
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(coll?&nbsp;(first&nbsp;tree))&nbsp;(or&nbsp;(simplify-qualifier&nbsp;(first&nbsp;tree))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(simplify-qualifier&nbsp;(rest&nbsp;tree)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(coll?&nbsp;tree)&nbsp;(simplify-qualifier&nbsp;(rest&nbsp;tree))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
041&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else&nbsp;tree))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
042&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
043&nbsp;&nbsp;(defn&nbsp;simplify-second-of-two
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&quot;There&nbsp;are&nbsp;a&nbsp;number&nbsp;of&nbsp;possible&nbsp;simplifications&nbsp;such&nbsp;that&nbsp;if&nbsp;the&nbsp;`tree`&nbsp;has
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;two&nbsp;elements,&nbsp;the&nbsp;second&nbsp;is&nbsp;semantically&nbsp;sufficient.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="partial" title="10 out of 11 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(=&nbsp;(count&nbsp;tree)&nbsp;2)&nbsp;(simplify-rule&nbsp;(nth&nbsp;tree&nbsp;1))&nbsp;tree))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
048&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;;;&nbsp;(defn&nbsp;simplify-quantifier
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&quot;If&nbsp;this&nbsp;quantifier&nbsp;is&nbsp;a&nbsp;number,&nbsp;&#x27;simplifiy&#x27;&nbsp;it&nbsp;into&nbsp;a&nbsp;comparative&nbsp;whose&nbsp;operator&nbsp;is&nbsp;&#x27;=&#x27;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
051&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;and&nbsp;whose&nbsp;quantity&nbsp;is&nbsp;that&nbsp;number.&nbsp;This&nbsp;is&nbsp;actually&nbsp;more&nbsp;complicated&nbsp;but&nbsp;makes&nbsp;generation&nbsp;easier.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
052&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
053&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;(if&nbsp;(number?&nbsp;(second&nbsp;tree))&nbsp;[:COMPARATIVE&nbsp;&#x27;=&nbsp;(second&nbsp;tree)]&nbsp;(simplify-rule&nbsp;(second&nbsp;tree))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
054&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
055&nbsp;&nbsp;(defn&nbsp;simplify-rule
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&quot;Simplify&#x2F;canonicalise&nbsp;this&nbsp;`tree`.&nbsp;Opportunistically&nbsp;replace&nbsp;complex&nbsp;fragments&nbsp;with
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;semantically&nbsp;identical&nbsp;simpler&nbsp;fragments&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;(if
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(coll?&nbsp;tree)
</span><br/>
<span class="covered" title="9 out of 9 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(case&nbsp;(first&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:ACTION&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="10 out of 10 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:ACTIONS&nbsp;(cons&nbsp;(first&nbsp;tree)&nbsp;(simplify-rule&nbsp;(rest&nbsp;tree)))
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CHANCE-IN&nbsp;nil
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
065&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:COMPARATIVE&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
066&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CONDITION&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
067&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:CONDITIONS&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:EXPRESSION&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
069&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROPERTY&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
070&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:PROPERTY-CONDITION-OR-EXPRESSION&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
071&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SPACE&nbsp;nil
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
072&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:THEN&nbsp;nil
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
073&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:AND&nbsp;nil
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
074&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:VALUE&nbsp;(simplify-second-of-two&nbsp;tree)
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
075&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove&nbsp;nil?&nbsp;(map&nbsp;simplify-rule&nbsp;tree)))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
076&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
077&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
078&nbsp;&nbsp;(defn&nbsp;simplify-determiner-condition
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
079&nbsp;&nbsp;&nbsp;&nbsp;[tree]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
080&nbsp;&nbsp;&nbsp;&nbsp;(apply&nbsp;vector
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
081&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons&nbsp;:DETERMINER-CONDITION
</span><br/>
<span class="not-covered" title="0 out of 2 forms covered">
082&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(cons
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
083&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(simplify-second-of-two&nbsp;(second&nbsp;tree))
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
084&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(rest&nbsp;(rest&nbsp;tree))))))
</span><br/>
</body>
</html>

View file

@ -0,0 +1,200 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../coverage.css"/> <title> mw_parser/utils.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001&nbsp;&nbsp;(ns&nbsp;^{:doc&nbsp;&quot;Utilities&nbsp;used&nbsp;in&nbsp;more&nbsp;than&nbsp;one&nbsp;namespace&nbsp;within&nbsp;the&nbsp;parser.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:author&nbsp;&quot;Simon&nbsp;Brooke&quot;}
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003&nbsp;&nbsp;&nbsp;&nbsp;mw-parser.utils)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
004&nbsp;&nbsp;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
005&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
006&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
007&nbsp;&nbsp;;;;;&nbsp;mw-parser:&nbsp;a&nbsp;rule&nbsp;parser&nbsp;for&nbsp;MicroWorld.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
008&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
009&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and&#x2F;or
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
010&nbsp;&nbsp;;;;;&nbsp;modify&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
011&nbsp;&nbsp;;;;;&nbsp;as&nbsp;published&nbsp;by&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
012&nbsp;&nbsp;;;;;&nbsp;of&nbsp;the&nbsp;License,&nbsp;or&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
013&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
014&nbsp;&nbsp;;;;;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
015&nbsp;&nbsp;;;;;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
016&nbsp;&nbsp;;;;;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
017&nbsp;&nbsp;;;;;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
018&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
019&nbsp;&nbsp;;;;;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
020&nbsp;&nbsp;;;;;&nbsp;along&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
021&nbsp;&nbsp;;;;;&nbsp;Foundation,&nbsp;Inc.,&nbsp;51&nbsp;Franklin&nbsp;Street,&nbsp;Fifth&nbsp;Floor,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02110-1301,
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
022&nbsp;&nbsp;;;;;&nbsp;USA.
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
023&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
024&nbsp;&nbsp;;;;;&nbsp;Copyright&nbsp;(C)&nbsp;2014&nbsp;Simon&nbsp;Brooke
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
025&nbsp;&nbsp;;;;;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
026&nbsp;&nbsp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
027&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
028&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
029&nbsp;&nbsp;(defn&nbsp;suitable-fragment?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;`true`&nbsp;if&nbsp;`tree-fragment`&nbsp;appears&nbsp;to&nbsp;be&nbsp;a&nbsp;tree&nbsp;fragment&nbsp;of&nbsp;the&nbsp;expected&nbsp;`type`.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;[tree-fragment&nbsp;type]
</span><br/>
<span class="partial" title="11 out of 12 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;(and&nbsp;(coll?&nbsp;tree-fragment)
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(keyword?&nbsp;type)
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(=&nbsp;(first&nbsp;tree-fragment)&nbsp;type)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
035&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
036&nbsp;&nbsp;(defn&nbsp;rule?
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
037&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;true&nbsp;if&nbsp;the&nbsp;argument&nbsp;appears&nbsp;to&nbsp;be&nbsp;a&nbsp;parsed&nbsp;rule&nbsp;tree,&nbsp;else&nbsp;false.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
038&nbsp;&nbsp;&nbsp;&nbsp;[maybe-rule]
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;(suitable-fragment?&nbsp;maybe-rule&nbsp;:RULE))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
040&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
041&nbsp;&nbsp;(defn&nbsp;TODO
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&quot;Marker&nbsp;to&nbsp;indicate&nbsp;I&#x27;m&nbsp;not&nbsp;yet&nbsp;finished!&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;[message]
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;message)
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
045&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
046&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
047&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
048&nbsp;&nbsp;(defn&nbsp;assert-type
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
049&nbsp;&nbsp;&nbsp;&nbsp;&quot;If&nbsp;`tree-fragment`&nbsp;is&nbsp;not&nbsp;a&nbsp;tree&nbsp;fragment&nbsp;of&nbsp;the&nbsp;expected&nbsp;`type`,&nbsp;throw&nbsp;an&nbsp;exception.&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
050&nbsp;&nbsp;&nbsp;&nbsp;[tree-fragment&nbsp;type]
</span><br/>
<span class="partial" title="12 out of 16 forms covered">
051&nbsp;&nbsp;&nbsp;&nbsp;(assert&nbsp;(suitable-fragment?&nbsp;tree-fragment&nbsp;type)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
052&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(throw&nbsp;(Exception.&nbsp;(format&nbsp;&quot;Expected&nbsp;a&nbsp;%s&nbsp;fragment&quot;&nbsp;type)))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
053&nbsp;&nbsp;
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
054&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
055&nbsp;&nbsp;(defn&nbsp;search-tree
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
056&nbsp;&nbsp;&nbsp;&nbsp;&quot;Return&nbsp;the&nbsp;first&nbsp;element&nbsp;of&nbsp;this&nbsp;tree&nbsp;which&nbsp;has&nbsp;this&nbsp;tag&nbsp;in&nbsp;a&nbsp;depth-first,&nbsp;left-to-right&nbsp;search&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
057&nbsp;&nbsp;&nbsp;&nbsp;[tree&nbsp;tag]
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
058&nbsp;&nbsp;&nbsp;&nbsp;(cond&nbsp;
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(=&nbsp;(first&nbsp;tree)&nbsp;tag)&nbsp;tree
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
060&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:else&nbsp;(first
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
061&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(remove&nbsp;nil?
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
062&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(map
</span><br/>
<span class="covered" title="4 out of 4 forms covered">
063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#(search-tree&nbsp;%&nbsp;tag)
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
064&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filter&nbsp;coll?&nbsp;(rest&nbsp;tree)))))))
</span><br/>
</body>
</html>