tconsttable2.nim 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. discard """
  2. nimout: '''61'''
  3. """
  4. # bug #2297
  5. import tables
  6. proc html5tags*(): TableRef[string, string] =
  7. var html5tagsCache: Table[string,string]
  8. if true:
  9. new(result)
  10. html5tagsCache = initTable[string, string]()
  11. html5tagsCache["a"] = "a"
  12. html5tagsCache["abbr"] = "abbr"
  13. html5tagsCache["b"] = "b"
  14. html5tagsCache["element"] = "element"
  15. html5tagsCache["embed"] = "embed"
  16. html5tagsCache["fieldset"] = "fieldset"
  17. html5tagsCache["figcaption"] = "figcaption"
  18. html5tagsCache["figure"] = "figure"
  19. html5tagsCache["footer"] = "footer"
  20. html5tagsCache["header"] = "header"
  21. html5tagsCache["form"] = "form"
  22. html5tagsCache["head"] = "head"
  23. html5tagsCache["hr"] = "hr"
  24. html5tagsCache["html"] = "html"
  25. html5tagsCache["iframe"] = "iframe"
  26. html5tagsCache["img"] = "img"
  27. html5tagsCache["input"] = "input"
  28. html5tagsCache["keygen"] = "keygen"
  29. html5tagsCache["label"] = "label"
  30. html5tagsCache["legend"] = "legend"
  31. html5tagsCache["li"] = "li"
  32. html5tagsCache["link"] = "link"
  33. html5tagsCache["main"] = "main"
  34. html5tagsCache["map"] = "map"
  35. html5tagsCache["menu"] = "menu"
  36. html5tagsCache["menuitem"] = "menuitem"
  37. html5tagsCache["meta"] = "meta"
  38. html5tagsCache["meter"] = "master"
  39. html5tagsCache["noscript"] = "noscript"
  40. html5tagsCache["object"] = "object"
  41. html5tagsCache["ol"] = "ol"
  42. html5tagsCache["optgroup"] = "optgroup"
  43. html5tagsCache["option"] = "option"
  44. html5tagsCache["output"] = "output"
  45. html5tagsCache["p"] = "p"
  46. html5tagsCache["pre"] = "pre"
  47. html5tagsCache["param"] = "param"
  48. html5tagsCache["progress"] = "progress"
  49. html5tagsCache["q"] = "q"
  50. html5tagsCache["rp"] = "rp"
  51. html5tagsCache["rt"] = "rt"
  52. html5tagsCache["ruby"] = "ruby"
  53. html5tagsCache["s"] = "s"
  54. html5tagsCache["script"] = "script"
  55. html5tagsCache["select"] = "select"
  56. html5tagsCache["source"] = "source"
  57. html5tagsCache["style"] = "style"
  58. html5tagsCache["summary"] = "summary"
  59. html5tagsCache["table"] = "table"
  60. html5tagsCache["tbody"] = "tbody"
  61. html5tagsCache["thead"] = "thead"
  62. html5tagsCache["td"] = "td"
  63. html5tagsCache["th"] = "th"
  64. html5tagsCache["template"] = "template"
  65. html5tagsCache["textarea"] = "textarea"
  66. html5tagsCache["time"] = "time"
  67. html5tagsCache["title"] = "title"
  68. html5tagsCache["tr"] = "tr"
  69. html5tagsCache["track"] = "track"
  70. html5tagsCache["ul"] = "ul"
  71. html5tagsCache["video"] = "video"
  72. result[] = html5tagsCache
  73. static:
  74. var i = 0
  75. for key, value in html5tags().pairs():
  76. inc i
  77. echo i