diff --git a/index.html b/index.html index 130a0cf..703ba17 100644 --- a/index.html +++ b/index.html @@ -38,8 +38,6 @@ msg = colored("66D9EF", msg); } else if (res.msgType == "error") { msg = colored("F92672", msg); - } else if (res.msgType == "info") { - msg = colored("E6DB74", msg); } return msg; diff --git a/index.js b/index.js index a9159ba..d36d236 100755 --- a/index.js +++ b/index.js @@ -67,8 +67,6 @@ if (interactive) { } else if (res.msgType == "error") { msg = "\n " + colored("31", msg); } else if (res.msgType == "info") { - msg = colored("33", msg); - } else if (res.msgType == "other") { msg = msg.replace(/`([^`\n]+)`/g, '\x1b[36m$1\x1b[0m'); msg = msg.replace(/\*([^\*\n]+)\*/g, '\x1b[01m$1\x1b[0m'); } diff --git a/src/Insect.purs b/src/Insect.purs index c302cdf..5b58c3a 100644 --- a/src/Insect.purs +++ b/src/Insect.purs @@ -25,7 +25,6 @@ msgTypeToString Info = "info" msgTypeToString Error = "error" msgTypeToString Value = "value" msgTypeToString ValueSet = "value-set" -msgTypeToString Other = "other" -- | Run Insect, REPL-style. repl ∷ Environment → String → { msg ∷ String diff --git a/src/Insect/Interpreter.purs b/src/Insect/Interpreter.purs index 53e7580..b434c9d 100644 --- a/src/Insect/Interpreter.purs +++ b/src/Insect/Interpreter.purs @@ -33,7 +33,7 @@ data EvalError type Expect = Either EvalError -- | Output types for highlighting. -data MessageType = Value | ValueSet | Info | Error | Other +data MessageType = Value | ValueSet | Info | Error -- | The output type of the interpreter. data Message = Message MessageType String @@ -119,7 +119,7 @@ runInsect env (Assignment n v) = case eval env v of Left evalErr → message Error env (Left evalErr) Right value → message ValueSet (insert n value env) (Right (fullSimplify value)) -runInsect env (Command Help) = { msg: Message Other (intercalate "\n" +runInsect env (Command Help) = { msg: Message Info (intercalate "\n" [ "" , "*insect* evaluates mathematical expressions that can" , "involve physical quantities. You can start by trying" @@ -135,7 +135,7 @@ runInsect env (Command Help) = { msg: Message Other (intercalate "\n" , "More information: https://github.com/sharkdp/insect" ]), newEnv : env } runInsect env (Command List) = - { msg: Message Other list + { msg: Message Info list , newEnv: env } where list = "List of variables:\n" <> foldMap toLine env