diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-23 18:04:11 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-23 18:04:23 -0700 |
| commit | 9f08215dfb179c3c37c18016fb0eafb7ec6e681e (patch) | |
| tree | 6d1108b07b9a0a57dbc6c3701bf9971c9144da40 /core | |
| parent | 247e55059ce94521895f362f5cdfdebf49bfb8e1 (diff) | |
Moved console colors from core/ into lib/
Diffstat (limited to 'core')
| -rw-r--r-- | core/metaprogramming.nom | 2 | ||||
| -rw-r--r-- | core/text.nom | 18 |
2 files changed, 1 insertions, 19 deletions
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 |
