tables work in 'const' sections; echo supports 'nil' strings; minor cleanups

This commit is contained in:
Araq
2015-02-09 00:08:14 +01:00
parent 9431b734b4
commit ecd0dea091
11 changed files with 69 additions and 52 deletions

19
tests/vm/tconsttable.nim Normal file
View File

@@ -0,0 +1,19 @@
discard """
output: '''is
finally
nice!'''
"""
import tables
const
foo = {"ah": "finally", "this": "is", "possible.": "nice!"}.toTable()
# protect against overly smart compiler:
var x = "this"
echo foo[x]
x = "ah"
echo foo[x]
x = "possible."
echo foo[x]