From e8c820b8f566297ef2330260c2d092012c3d2622 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 8 Oct 2017 20:41:05 -0700 Subject: Moved colors to only when invoking from command line. --- nomsu.moon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nomsu.moon') diff --git a/nomsu.moon b/nomsu.moon index cff64b0..5167e0b 100755 --- a/nomsu.moon +++ b/nomsu.moon @@ -15,7 +15,7 @@ re = require 're' lpeg = require 'lpeg' utils = require 'utils' repr = utils.repr -colors = require 'consolecolors' +colors = setmetatable({}, {__index:->""}) colored = setmetatable({}, {__index:(_,color)-> ((msg)-> colors[color]..msg..colors.reset)}) {:insert, :remove, :concat} = table --pcall = (fn,...)-> true, fn(...) @@ -591,6 +591,8 @@ class NomsuCompiler if arg + export colors + colors = require 'consolecolors' parser = re.compile([[ args <- {| {:flags: flags? :} ({:input: input :} ";" ("-o;"{:output: output :} ";")?)? (";")? |} !. flags <- (({| ({flag} ";")* |}) -> set) -- cgit v1.2.3