From 9f08215dfb179c3c37c18016fb0eafb7ec6e681e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 23 Jun 2018 18:04:11 -0700 Subject: Moved console colors from core/ into lib/ --- core/metaprogramming.nom | 2 +- core/text.nom | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) (limited to 'core') diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index 8b33e52..f9cb4e9 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -2,7 +2,7 @@ This File contains actions for making actions and compile-time actions and some helper functions to make that easier. -lua> "NOMSU_CORE_VERSION = 1" +lua> "NOMSU_CORE_VERSION = 2" lua> ".." nomsu.COMPILE_ACTIONS["% -> %"] = function(nomsu, tree, \%args, \%body) diff --git a/core/text.nom b/core/text.nom index b576127..a9b2540 100644 --- a/core/text.nom +++ b/core/text.nom @@ -37,23 +37,5 @@ lua> ".." local lua = "'"..e.."'" nomsu.COMPILE_ACTIONS[name] = (function(nomsu, tree) return LuaCode.Value(tree.source, lua) end) end - local colors = { - ["reset color"]="\\\\27[0m", bright="\\\\27[1m", dim="\\\\27[2m", underscore="\\\\27[4m", - blink="\\\\27[5m", inverse="\\\\27[7m", hidden="\\\\27[8m", - - black="\\\\27[30m", red="\\\\27[31m", green="\\\\27[32m", yellow="\\\\27[33m", blue="\\\\27[34m", - magenta="\\\\27[35m", cyan="\\\\27[36m", white="\\\\27[37m", - - ["on black"]="\\\\27[40m", ["on red"]="\\\\27[41m", ["on green"]="\\\\27[42m", ["on yellow"]="\\\\27[43m", - ["on blue"]="\\\\27[44m", ["on magenta"]="\\\\27[45m", ["on cyan"]="\\\\27[46m", ["on white"]="\\\\27[47m", - }; - for name, c in pairs(colors) do - local color = "'"..c.."'"; - local reset = "'"..colors["reset color"].."'"; - nomsu.COMPILE_ACTIONS[name] = (function(nomsu, tree) return LuaCode.Value(tree.source, color) end) - nomsu.COMPILE_ACTIONS[name.." %"] = (function(nomsu, tree, text) - return LuaCode.Value(tree.source, color, "..", nomsu:tree_to_lua(text), "..", reset); - end) - end end -- cgit v1.2.3