aboutsummaryrefslogtreecommitdiff
path: root/core/text.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-09-10 16:26:08 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-09-10 16:26:27 -0700
commit7c6047254e5aa7ce5a0667b14676b22a7447f956 (patch)
treef98478e6c77257610e43dc45447cd23e91bdaaae /core/text.nom
parentc859eac2beb20889e162ca28f889cc02ac592266 (diff)
Upgraded to 3.8 (text method changes) and fixed some bugs in
tree_to_nomsu.
Diffstat (limited to 'core/text.nom')
-rw-r--r--core/text.nom26
1 files changed, 1 insertions, 25 deletions
diff --git a/core/text.nom b/core/text.nom
index bd9335a..da9d550 100644
--- a/core/text.nom
+++ b/core/text.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V3.7.5.6
+#!/usr/bin/env nomsu -V3.8.7.6
#
This file contains some definitions of text escape sequences, including ANSI console
color codes.
@@ -26,36 +26,12 @@ test:
assume ("asdf"::uppercase) == "ASDF"
assume ("asdf"::with "s" -> "X") == "aXdf"
assume ("one\ntwo\n"::lines) == ["one", "two", ""]
-
parse [アクション %spec %body] as (action %spec %body)
test:
%こんにちは = "こんにちは"
アクション [% と言う] "\(%)世界"
assume (%こんにちは と言う) == "こんにちは世界"
-# Text functions
-parse [%texts joined with %glue] as (%texts::joined with %glue)
-parse [%texts joined, joined %texts] as (%texts::joined)
-parse [byte %i of %text] as (%text::byte %i)
-parse [bytes %start to %stop of %text] as (%text::bytes %start to %stop)
-parse [bytes of %text] as (%text::bytes)
-parse [capitalized %text, %text capitalized] as (%text::capitalized)
-parse [uppercase %text, %text uppercase] as (%text::uppercase)
-parse [..]
- %text with %sub instead of %patt, %text with %patt replaced by %sub
- %text s/ %patt / %sub
-..as (%text::with %patt -> %sub)
-parse [%text matches %pattern] as (%text::matches %pattern)
-parse [%text matching %pattern] as ((%text::matching %pattern).1)
-
-compile [for %match in %text matching %patt %body] to (..)
- Lua ".."
- for \(%match as lua expr) in (\(%text as lua expr)):gmatch(\(%patt as lua expr)) do
- \(%body as lua statements)
- \(compile as (===next %match ===))
- end
- \(compile as (===stop %match ===))
-
compile [%expr for %match in %text matching %patt] to (..)
Lua value ".."
(function()