Skip to content

Commit

Permalink
Remove 'other' message type
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Mar 22, 2017
1 parent d859634 commit ea21d5f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
1 change: 0 additions & 1 deletion src/Insect.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Insect/Interpreter.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit ea21d5f

Please sign in to comment.