From 08575e2aecbbb5bed8ebc79ba270e605276a69ae Mon Sep 17 00:00:00 2001 From: def Date: Thu, 9 Apr 2015 17:28:26 +0200 Subject: [PATCH] Add test case for infinite loop in RE --- tests/stdlib/treloop.nim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/stdlib/treloop.nim diff --git a/tests/stdlib/treloop.nim b/tests/stdlib/treloop.nim new file mode 100644 index 0000000000..35236708cb --- /dev/null +++ b/tests/stdlib/treloop.nim @@ -0,0 +1,9 @@ +discard """ + output: "@[(, +, 1, 2, )]" +""" + +import re + +let str = "(+ 1 2)" +var tokenRE = re"""[\s,]*(~@|[\[\]{}()'`~^@]|"(?:\\.|[^\\"])*"|;.*|[^\s\[\]{}('"`,;)]*)""" +echo str.findAll(tokenRE)