mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
14 lines
242 B
Nim
14 lines
242 B
Nim
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'")
|