diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-10-30 23:42:04 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-10-30 23:42:36 -0700 |
| commit | ea3197aaffba00318920ed5e1e33ca5f2a5e6c5c (patch) | |
| tree | 2ec4aff13c7a54a3730994525b591ac60528b5ad /lib/base64.nom | |
| parent | e7e84c9eda38c930f5475301de4a449dcf59e8b6 (diff) | |
Fully working version of (action [foo]: baz) -> ((foo) means: baz)
refactor and misc other changes.
Diffstat (limited to 'lib/base64.nom')
| -rw-r--r-- | lib/base64.nom | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/base64.nom b/lib/base64.nom index 8fc4e6b..2091615 100644 --- a/lib/base64.nom +++ b/lib/base64.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.8.8.6 +#!/usr/bin/env nomsu -V4.8.10 # This file defines actions for encoding/decoding base 64, as specified in: https://tools.ietf.org/html/rfc4648 @@ -13,7 +13,7 @@ test: %plain = "foobar".[1, %len - 1] assume (base64 %plain) == %encoded assume (base64 decode %encoded) == %plain -action [base64 %str, base64 encode %str, %str base64]: +externally [base64 %str, base64 encode %str, %str base64] all mean: %chars = [] for %i in 1 to (size of %str) via 3: %bytes = [=lua "\%str:byte(\%i, \(%i + 2))"] @@ -36,8 +36,8 @@ action [base64 %str, base64 encode %str, %str base64]: return (%chars::joined) -action [chr %] (=lua "string.char(\%)") -action [decode base64 %str, %str base64 decoded, base64 decode %str]: +externally (chr %) means (=lua "string.char(\%)") +externally [decode base64 %str, %str base64 decoded, base64 decode %str] all mean: %chars = [] for %i in 1 to (size of %str) via 4: %indices = (%reverse_b64.(%str.%) for % in %i to (%i + 3)) |
