summary refs log tree commit diff stats
path: root/tests/stdlib/treloop.nim
blob: b4221525d28237b9971368803f3699761fdcf95f (plain) (blame)
1
2
3
4
5
6
7
8
9
discard """
  output: '''@["(", "+", " 1", " 2", ")"]'''
"""

import re

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