mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
9 lines
188 B
Nim
9 lines
188 B
Nim
# Shows how to transform a file
|
|
|
|
import pegs
|
|
|
|
transformFile("infile.txt", "outfile.txt",
|
|
[(peg"""S <- {typedesc} \s* {\ident} \s* ','
|
|
typedesc <- \ident '*'* """, r"$2: $1")])
|
|
|