Files
Nim/tests/casestmt/tlinearscanend.nim
Adam Strzelecki e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00

25 lines
343 B
Nim

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"