changed robotwar files & folders to remove 'hs-' prefix

This commit is contained in:
Richard Harrington 2013-07-19 16:32:47 -04:00
parent 37c2428592
commit 411b9013ef
3 changed files with 17 additions and 14 deletions

View File

@ -1,7 +1,7 @@
(defproject hs-robotwar "0.1.0-SNAPSHOT"
(defproject robotwar "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]]
:main hs-robotwar.core)
:main robotwar.core)

View File

@ -1,4 +1,4 @@
(ns hs-robotwar.core)
(ns robotwar.core)
(use '[clojure.set :only (union)])
(use '[clojure.string :only (split join)])
@ -104,14 +104,15 @@
:label (recur tail (conj result [token nil]))))))
(defn pretty-print-tokens [token-seq]
(join
"\n"
(map #(format "%2d %s %s" (:pos %) (:type %) (:val %))
token-seq)))
(defn evaluate [token-seq]
(println (pretty-print-tokens token-seq)))
"This is hacky and just a temporary display function"
(letfn [(f [[fst snd]]
(if snd
(format "%2d %9s %8s %20d %9s %11s"
(:pos fst) (:type fst) (:val fst)
(:pos snd) (:type snd) (:val snd))
(format "%2d %9s %8s"
(:pos fst) (:type fst) (:val fst))))]
(join "\n" (map f token-seq))))
(defn repl
"make it so"
@ -123,7 +124,9 @@
lex
parse
disambiguate-minus-signs
evaluate)
rw-compile
pretty-print-tokens
println)
(recur (read-line)))))

View File

@ -1,6 +1,6 @@
(ns hs-robotwar.core-test
(ns robotwar.core-test
(:require [clojure.test :refer :all]
[hs-robotwar.core :refer :all]))
[robotwar.core :refer :all]))
(def line1 "IF DAMAGE # D GOTO MOVE ; comment or something")