From 7c6047254e5aa7ce5a0667b14676b22a7447f956 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 10 Sep 2018 16:26:08 -0700 Subject: Upgraded to 3.8 (text method changes) and fixed some bugs in tree_to_nomsu. --- core/text.nom | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'core/text.nom') 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() -- cgit v1.2.3