diff --git a/nomsu.lua b/nomsu.lua index 29879b9..0ed111c 100644 --- a/nomsu.lua +++ b/nomsu.lua @@ -2,7 +2,11 @@ local re = require('re') local lpeg = require('lpeg') local utils = require('utils') local repr = utils.repr -local colors = require('consolecolors') +local colors = setmetatable({ }, { + __index = function() + return "" + end +}) local colored = setmetatable({ }, { __index = function(_, color) return (function(msg) @@ -842,6 +846,7 @@ do NomsuCompiler = _class_0 end if arg then + colors = require('consolecolors') local parser = re.compile([[ args <- {| {:flags: flags? :} ({:input: input :} ";" ("-o;"{:output: output :} ";")?)? (";")? |} !. flags <- (({| ({flag} ";")* |}) -> set) flag <- "-c" / "-i" / "-p" / "-f" / "--help" / "-h" 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)