summary refs log tree commit diff stats
path: root/tests/patterns/thoist.nim
blob: 7d14c0abf00a97a7f9f6b33622b123079f68c826 (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}): TPeg =
  var gl {.global, gensym.} = peg(pattern)
  gl

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