summary refs log tree commit diff stats
path: root/tests/accept/compile/tlinearscanend.nim
blob: 15fd0c70a17d0d548e586439bc4770cca30813c5 (plain) (blame)
1
2
3
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: b
import strutils

var x = 343

case stdin.readline.parseInt
of 0: 
  echo "most common case"
of 1: 
  {.linearScanEnd.}
  echo "second most common case"
of 2: echo "unlikely: use branch table"
else: 
  echo "unlikely too: use branch table"


case x
of 23: echo "23"
of 343: echo "343"
of 21: echo "21"
else: 
  {.linearScanEnd.}
  echo "default"