aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/text.nom8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/text.nom b/core/text.nom
index 86d8d45..50a0ab5 100644
--- a/core/text.nom
+++ b/core/text.nom
@@ -48,6 +48,14 @@ test:
test:
assume "\n" == (newline)
+test:
+ assume (0xDEADBEEF as hex) == "0xDEADBEEF"
+externally (%num as hex) means:
+ if (%num < 0):
+ return ("-0x%X"::formatted with (- %num))
+ ..else:
+ return ("0x%X"::formatted with %num)
+
# Text literals
%escapes = {..}
nl: "\n", newline: "\n", tab: "\t", bell: "\a", cr: "\r", "carriage return": "\r"