summary refs log blame commit diff stats
path: root/examples/transff.nim
blob: 32d17e52c29a15ad09aa6ff429d81821c1f62a35 (plain) (tree)
1
2
3
4
5
6
7
8







                                                  
# Shows how to transform a file

import pegs

transformFile("infile.txt", "outfile.txt",
  [(peg"""S <- {typedesc} \s* {\ident} \s* ','
         typedesc <- \ident '*'* """, r"$2: $1")])