Add missing $ to standard types

This commit is contained in:
Ruslan Mustakov 2017-08-06 13:58:54 +07:00
commit 6aaeed4dca
6 changed files with 58 additions and 24 deletions

View file

@ -97,3 +97,14 @@ iterator values*(dict: Dictionary): Variant =
iterator pairs*(dict: Dictionary): tuple[key, val: Variant] =
for key in keys(dict):
yield (key, dict[key])
proc `$`*(self: Dictionary): string =
result = newStringOfCap(32)
result.add('{')
for k, v in self:
if result.len > 1:
result.add(", ")
result.add($k)
result.add(": ")
result.add($v)
result.add('}')