aboutsummaryrefslogtreecommitdiff
path: root/core/text.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-09-14 19:17:09 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-09-14 19:17:16 -0700
commite22c35681f90740b4f5006c30b3f154ebd1f8ea2 (patch)
treec7f04d968bade120ebf75cfa0b9f073602917122 /core/text.nom
parent7112af7cb6ee52f4ef9664db9c03db52d8c73ac9 (diff)
Auto-upgraded everything.
Diffstat (limited to 'core/text.nom')
-rw-r--r--core/text.nom31
1 files changed, 13 insertions, 18 deletions
diff --git a/core/text.nom b/core/text.nom
index da9d550..25e9c3c 100644
--- a/core/text.nom
+++ b/core/text.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V3.8.7.6
+#!/usr/bin/env nomsu -V4.8.8.6
#
This file contains some definitions of text escape sequences, including ANSI console
color codes.
@@ -8,16 +8,12 @@ use "core/metaprogramming.nom"
test:
assume "\[1, 2, 3]" == "[1, 2, 3]"
assume "foo = \(1 + 2)!" == "foo = 3!"
- assume (..)
- ".."
- one
- two
- ..== "one\ntwo"
- assume (..)
- ".."
- no\
- ..gap
- ..== "nogap"
+ assume "one\ntwo" == "\
+ ..one
+ two"
+ assume "nogap" == "\
+ ..no\
+ ..gap"
assume (["x", "y"]::joined with ",") == "x,y"
assume (["x", "y"]::joined) == "xy"
assume ("BAR"::byte 2) == 65
@@ -31,10 +27,9 @@ test:
%こんにちは = "こんにちは"
アクション [% と言う] "\(%)世界"
assume (%こんにちは と言う) == "こんにちは世界"
-
compile [%expr for %match in %text matching %patt] to (..)
- Lua value ".."
- (function()
+ Lua value "\
+ ..(function()
local ret = _List{}
for \(%match as lua expr) in (\(%text as lua expr)):gmatch(\(..)
%patt as lua expr
@@ -42,14 +37,14 @@ compile [%expr for %match in %text matching %patt] to (..)
ret[#ret+1] = \(%expr as lua statements)
end
return ret
- end)()
+ end)()"
test:
assume "\n" == (newline)
# Text literals
-lua> ".."
- do
+lua> "\
+ ..do
local escapes = {
nl="\\\\n", newline="\\\\n", tab="\\\\t", bell="\\\\a", cr="\\\\r",
["carriage return"]="\\\\r", backspace="\\\\b", ["form feed"]="\\\\f",
@@ -61,4 +56,4 @@ lua> ".."
return LuaCode.Value(tree.source, lua)
end
end
- end
+ end"