mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-10-12 06:23:41 +00:00
got rid of old commented-out code
This commit is contained in:
parent
b0fe08bd80
commit
8e98cbfe63
@ -76,65 +76,3 @@
|
|||||||
(recur (read-line)))))
|
(recur (read-line)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; (def error-type-map
|
|
||||||
; {:parse-error "Parse Error"
|
|
||||||
; :end-of-line-error "End of Line Error"})
|
|
||||||
|
|
||||||
; (defn error
|
|
||||||
; [error-type error-string]
|
|
||||||
; (str (error-type-map error-type) ": " error-string))
|
|
||||||
|
|
||||||
; (defn valid-number-string
|
|
||||||
; [n]
|
|
||||||
; (re-find #"^-?\d+\.?\d*$" n))
|
|
||||||
|
|
||||||
; (defn number-or-string
|
|
||||||
; [x]
|
|
||||||
; (if (valid-number-string x)
|
|
||||||
; (Float/parseFloat x)
|
|
||||||
; x))
|
|
||||||
|
|
||||||
; (defn string-with-idx
|
|
||||||
; [s, idx]
|
|
||||||
; (if (empty? s)
|
|
||||||
; nil
|
|
||||||
; {:token s
|
|
||||||
; :idx idx}))
|
|
||||||
|
|
||||||
; (defn tokens-with-column-numbers
|
|
||||||
; "splits a string and returns a sequence of hashmaps,
|
|
||||||
; with column-number metadata. separated just by spaces
|
|
||||||
; for now. In the future, tokens won't necessarily have
|
|
||||||
; spaces between them."
|
|
||||||
; [s]
|
|
||||||
; (let [len (count s)]
|
|
||||||
; (loop [s s
|
|
||||||
; idx 0
|
|
||||||
; partial-word ""
|
|
||||||
; result []]
|
|
||||||
; (let [first-s (subs s 0 1)
|
|
||||||
; rest-s (subs s 1)]
|
|
||||||
; (cond
|
|
||||||
; (empty? s) (if (empty? partial-word)
|
|
||||||
; result
|
|
||||||
; (conj result (str-with-idx partial-word idx))
|
|
||||||
; (re-find #"\s" first-s) (if (empty? partial-word)
|
|
||||||
; (recur rest-s idx "" result)
|
|
||||||
; (recur rest-s idx "" (conj result (str-with-idx
|
|
||||||
; partial-word idx))))
|
|
||||||
; :else (if (empty? partial-word)
|
|
||||||
; (recur rest-s (- len (count s)) first-s result)
|
|
||||||
; (recur rest-s idx (str partial-word first-s) result))))))))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; (defn validate-expr
|
|
||||||
; "right now just checks to see whether it's a number.
|
|
||||||
; will do a lot more things in the future."
|
|
||||||
; [expr]
|
|
||||||
; (if (number? expr)
|
|
||||||
; [expr nil]
|
|
||||||
; [expr (error :parse-error "Not a number")]))
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user