diff options
Diffstat (limited to 'tests/accept')
-rw-r--r-- | tests/accept/run/tcase_setconstr.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/accept/run/tcase_setconstr.nim b/tests/accept/run/tcase_setconstr.nim new file mode 100644 index 000000000..21f657c2b --- /dev/null +++ b/tests/accept/run/tcase_setconstr.nim @@ -0,0 +1,15 @@ +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") + |