Files
Nim/tests/run/tcase_setconstr.nim
2011-11-19 15:45:51 +01:00

16 lines
265 B
Nim
Executable File

discard """
output: "an identifier"
"""
const
SymChars: set[char] = {'a'..'z', 'A'..'Z', '\x80'..'\xFF'}
proc classify(s: string) =
case s[0]
of SymChars, '_': echo "an identifier"
of {'0'..'9'}: echo "a number"
else: echo "other"
classify("Hurra")