diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-11 15:27:15 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-11 15:27:15 -0800 |
| commit | 1e0dc6e4775168c2610774ea29ed512c5451afe6 (patch) | |
| tree | 1c3eae7795ad7aea914b11c91dfc167464487694 /lib/utils.nom | |
| parent | 60aa3f5fcf5db2953e3b215cd85a6b20fb8728fb (diff) | |
Moved text utilities into their own file.
Diffstat (limited to 'lib/utils.nom')
| -rw-r--r-- | lib/utils.nom | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/utils.nom b/lib/utils.nom index 8ed196d..2b72080 100644 --- a/lib/utils.nom +++ b/lib/utils.nom @@ -93,27 +93,3 @@ compile [sort %items by %key_expr] to: ".." return \(%key_expr as lua); end) -# Text utilities -compile [nl, newline, line feed, linefeed, lf] to: "'\\n'" -compile [tab] to: "'\\t'" -compile [bell] to: "'\\a'" -compile [cr, carriage return] to: "'\\r'" -compile [backspace] to: "'\\b'" -compile [form feed, formfeed] to: "'\\f'" -compile [vertical tab] to: "'\\v'" - -lua> ".." - do - local colors = { - ["reset color"] = 0, bright = 1, dim = 2, underscore = 4, blink = 5, - inverse = 7, hidden = 8, black = 30, red = 31, green = 32, yellow = 33, - blue = 34, magenta = 35, cyan = 36, white = 37, ["on black"] = 40, - ["on red"] = 41, ["on green"] = 42, ["on yellow"] = 43, ["on blue"] = 44, - ["on magenta"] = 45, ["on cyan"] = 46, ["on white"] = 47, - }; - for name,code in pairs(colors) do - local escape = "\\"\\\\27["..tostring(code).."m\\"" - nomsu:define_compile_action(name, \(__line_no__), function() return escape end, ""); - end - end - |
