From 4a3a07e354011f489b465b67381ea3e363665194 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Mon, 10 Jun 2024 11:43:51 +0100 Subject: [PATCH] Missed from last commit -- still doesn't work. --- src/antonine/core.clj | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/antonine/core.clj b/src/antonine/core.clj index 9161de7..8b4acf5 100644 --- a/src/antonine/core.clj +++ b/src/antonine/core.clj @@ -1,11 +1,9 @@ (ns antonine.core - (:require [antonine.calculator :refer [calculate write-roman]] + (:require [antonine.calculator :refer [calculate grammar write-roman]] [antonine.char-reader :refer [read-chars]] - [clojure.java.io :refer [resource]] [clojure.pprint :refer [pprint]] [clojure.string :as s] - [clojure.tools.cli :refer [parse-opts]] - [instaparse.core :refer [parser]]) + [clojure.tools.cli :refer [parse-opts]]) (:gen-class)) (defn- romanise [arg] @@ -30,8 +28,6 @@ ;; A boolean option defaulting to nil ["-h" "--help"]]) -(def grammar (parser (resource "grammar.bnf"))) - (defn repl "Read/eval/print loop, using these command line `options`." [options] @@ -47,10 +43,9 @@ (ex-info (format "\nVALE %s" (romanise (System/getProperty "user.name"))) {:cause :quit})) - (let [tree (grammar input) - v (calculate tree)] + (let [v (calculate input)] (when (> vrb 1) - (println (format "(Parse tree: %s)" tree))) + (println (format "(Parse tree: %s)" (grammar input)))) (when (> vrb 0) (println (format "(Arabic: %d)" v))) (println (write-roman v)))) (println))