Add test case for infinite loop in RE
This commit is contained in:
parent
69d38f82a5
commit
08575e2aec
1 changed files with 9 additions and 0 deletions
9
tests/stdlib/treloop.nim
Normal file
9
tests/stdlib/treloop.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
output: "@[(, +, 1, 2, )]"
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
let str = "(+ 1 2)"
|
||||
var tokenRE = re"""[\s,]*(~@|[\[\]{}()'`~^@]|"(?:\\.|[^\\"])*"|;.*|[^\s\[\]{}('"`,;)]*)"""
|
||||
echo str.findAll(tokenRE)
|
||||
Loading…
Add table
Add a link
Reference in a new issue