summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-01-13 14:34:24 -0800
committerAndreas Rumpf <rumpf_a@web.de>2014-01-13 14:34:24 -0800
commit90721375e2e92763c24193960b686d143aa2b091 (patch)
treef44a902c40f35937f045ef14536921020fe17b3f /lib/pure
parent1e4c4d62e4d4ccda50d657fbd761da36a462f00d (diff)
parent40bd63f83b045ab88c2da232d4848566aa5008ca (diff)
downloadNim-90721375e2e92763c24193960b686d143aa2b091.tar.gz
Merge pull request #779 from brihat/master
Define $ operator for TRune
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/unicode.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/unicode.nim b/lib/pure/unicode.nim
index 4aacb2f71..f90fc2745 100644
--- a/lib/pure/unicode.nim
+++ b/lib/pure/unicode.nim
@@ -132,6 +132,10 @@ proc toUTF8*(c: TRune): string {.rtl, extern: "nuc$1".} =
     result = newString(1)
     result[0] = chr(i)
 
+proc `$`*(rune: TRune): string =
+  ## converts a rune to a string
+  rune.toUTF8
+
 proc `$`*(runes: seq[TRune]): string =
   ## converts a sequence of runes to a string
   result = ""