aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/format
diff options
context:
space:
mode:
authorEduardo Julian2023-01-26 02:39:27 -0400
committerEduardo Julian2023-01-26 02:39:27 -0400
commitf391f448f4fe6508502a68aa1c51d60475967952 (patch)
tree0ebfaee3aee8d2083e20917157eb8dab6c2f47c3 /stdlib/source/format
parent70aa7154e64c0ab2352c00e5f993e88737929ccc (diff)
Optimized Tar parsing in order to fix stack-overflow when loading cache.
Diffstat (limited to 'stdlib/source/format')
-rw-r--r--stdlib/source/format/lux/data/text.lux20
1 files changed, 20 insertions, 0 deletions
diff --git a/stdlib/source/format/lux/data/text.lux b/stdlib/source/format/lux/data/text.lux
index d998310ae..e4adae6f7 100644
--- a/stdlib/source/format/lux/data/text.lux
+++ b/stdlib/source/format/lux/data/text.lux
@@ -87,6 +87,26 @@
[json json.JSON (of json.codec encoded)]
)
+(with_template [<suffix> <name>]
+ [(def .public <name>
+ (Format Frac)
+ (|>> ((template.symbol [frac._] [<name>]))
+ frac.int
+ ..int
+ (text.suffix <suffix>)))]
+
+ ["%" percentage]
+
+ ... https://en.wikipedia.org/wiki/Degree_symbol
+ ["°" degree]
+
+ ... https://en.wikipedia.org/wiki/Per_mille
+ ["‰" permille]
+
+ ... https://en.wikipedia.org/wiki/Basis_point
+ ["‱" permyriad]
+ )
+
(with_template [<type> <format>,<codec>]
[(`` (with_template [<format> <codec>]
[(def .public <format>