summary refs log tree commit diff stats
path: root/examples/transff.nim
diff options
context:
space:
mode:
Diffstat (limited to 'examples/transff.nim')
-rwxr-xr-xexamples/transff.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/transff.nim b/examples/transff.nim
new file mode 100755
index 000000000..32d17e52c
--- /dev/null
+++ b/examples/transff.nim
@@ -0,0 +1,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")])
+