summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.fnl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/utils.fnl b/lib/utils.fnl
index 917f4af..046f646 100644
--- a/lib/utils.fnl
+++ b/lib/utils.fnl
@@ -8,4 +8,12 @@
(print (.. what ": " (/ (- (must (luna.time.now)) start) 1e6)))
(values (table.unpack res)))
-{: must : measure}
+(fn test-peg [file peg]
+ (local fennel (require :vendor.fennel))
+ (local parser (require :parser.parser))
+ (with-open [f (io.open file "r")]
+ (local contents (f:read :*all))
+ (print (fennel.view (parser.match-many contents peg))))
+ (os.exit 1))
+
+{: must : measure : test-peg}