summary refs log tree commit diff stats
path: root/tests/trmacros/thoist.nim
blob: 657f210a176ffd5d939ba5d7b805633338050a02 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
discard """
  output: '''true
true'''
"""

import pegs

template optPeg{peg(pattern)}(pattern: string{lit}): Peg =
  var gl {.global, gensym.} = peg(pattern)
  gl

echo match("(a b c)", peg"'(' @ ')'")
echo match("W_HI_Le", peg"\y 'while'")