diff --git a/resources/public/docs/mw-engine/uberdoc.html b/resources/public/docs/mw-engine/uberdoc.html index fb03a49..843e0b9 100644 --- a/resources/public/docs/mw-engine/uberdoc.html +++ b/resources/public/docs/mw-engine/uberdoc.html @@ -3371,8 +3371,10 @@ ignored). Darker shades are higher.

* `value` a value of that property
(defn get-neighbours-with-property-value
+  ([world x y depth property value comparator]
+    (filter #(apply comparator (list (get % property) value)) (get-neighbours world x y depth)))
   ([world x y depth property value]
-    (filter #(= (get % property) value) (get-neighbours world x y depth)))
+    (get-neighbours-with-property-value world x y depth property value =))
   ([world cell depth property value]
     (get-neighbours-with-property-value world (:x cell) (:y cell) depth 
                                         property value))
diff --git a/resources/public/docs/mw-parser/uberdoc.html b/resources/public/docs/mw-parser/uberdoc.html
index 199cb45..b3b9e2d 100644
--- a/resources/public/docs/mw-parser/uberdoc.html
+++ b/resources/public/docs/mw-parser/uberdoc.html
@@ -3035,29 +3035,36 @@ objective is to parse rules out of a block of text from a textarea

(ns mw-parser.bulk
   (:use mw-parser.core
         mw-engine.utils
-        clojure.java.io)
-  (:import (java.io BufferedReader StringReader)))
-
(defn parse-line [line]
-  (let [initial (first line)]
-    (cond
-      (member? initial '(nil \# \;)) nil
-      true (parse-rule line))))

Parse rules from lines returned by this reader. Ignore - lines starting with ;;, but otherwise throw an exception if any - line cannot be parsed.

-
(defn- parse-from-reader 
-  [reader]
-  (remove nil?
-          (map parse-line
-               (line-seq reader))))

Parse rules from successive lines in the file loaded from this filename

+ clojure.java.io + [clojure.string :only [split trim]]) + (:import (java.io BufferedReader StringReader)))

Is this line a comment?

+
(defn comment? 
+  [line]
+  (or (empty? (trim line)) (member? (first line) '(nil \# \;))))

Parse rules from successive lines in this string, assumed to have multiple + lines delimited by the new-line character. Return a list of S-expressions.

+
(defn parse-string 
+  [string]
+        ;; TODO: tried to do this using with-open, but couldn't make it work.
+  (map parse-rule (remove comment? (split string #"\n"))))

Parse rules from successive lines in the file loaded from this filename. + Return a list of S-expressions.

(defn parse-file 
   [filename]
-  (with-open [rdr (reader filename)]
-    (remove nil?
-          (map parse-line 
-               (line-seq rdr)))))

Parse rules from successive lines in this string

-
(defn parse-string
-   [string]
-   (parse-from-reader (BufferedReader. (StringReader. string))))
 

mw-parser.core

toc

A very simple parser which parses production rules of the following forms:

+ (parse-string (slurp filename)))

Compile each non-comment line of this string into an executable anonymous + function, and return the sequence of such functions.

+
(defn compile-string
+  [string]
+  (map compile-rule (split string #"\n")))

Compile each non-comment line of the file indicated by this filename into + an executable anonymous function, and return the sequence of such functions.

+
(defn compile-file 
+  [filename]
+  (compile-string (slurp filename)))

(let [lines + (doall (with-open [rdr (reader filename)] (line-seq rdr)))] + (map parse-line lines)))

+

(defn parse-string + "Parse rules from successive lines in this string" + [string] + (parse-from-reader (BufferedReader. (StringReader. string))))

mw-parser.core

toc

A very simple parser which parses production rules of the following forms: