Update regex

This commit is contained in:
erik 2023-06-22 11:57:17 +02:00
parent 888082ab84
commit a159ed93ab

View file

@ -6,15 +6,26 @@
; pre-format ; pre-format
(defn delete-comments-and-newlines [resource-file] (defn delete-comments-and-newlines [resource-file]
(apply str (str/join "\n"
(remove (remove
#(or (re-matches #"^#.*" %) (re-matches #"" %)) #(or (re-matches #"^#.*" %) (re-matches #"" %))
(str/split-lines (str/split-lines
(slurp resource-file))))) (slurp resource-file)))))
; find definitions ; find definitions
; find definitions algo
; walk through list
; check the current element
; does it have a dot at the end?
; yes
; put it in the current list
; if this does not exist, create it
; the next element goes into a new list
;
; no
; put it in the current list
(defn find-definitions [string-input] (defn find-definitions [string-input]
(str/split string-input #" \.")) ;ToDo this is crap, splits need tbd differently (str/split string-input #"\.\n|\.$"))
; make list of vectors/map from well known input-string ; make list of vectors/map from well known input-string