Add test case for infinite loop in RE

This commit is contained in:
def
2015-04-09 17:28:26 +02:00
parent 69d38f82a5
commit 08575e2aec

9
tests/stdlib/treloop.nim Normal file
View File

@@ -0,0 +1,9 @@
discard """
output: "@[(, +, 1, 2, )]"
"""
import re
let str = "(+ 1 2)"
var tokenRE = re"""[\s,]*(~@|[\[\]{}()'`~^@]|"(?:\\.|[^\\"])*"|;.*|[^\s\[\]{}('"`,;)]*)"""
echo str.findAll(tokenRE)