about summary refs log tree commit diff stats
path: root/test-fff.scm
diff options
context:
space:
mode:
authorCase Duckworth2023-03-21 09:44:56 -0500
committerCase Duckworth2023-03-21 09:44:56 -0500
commitd7d4e2c94adc91d8bcc5647174d74514aa23df12 (patch)
treebd947caf5860cda71226f82b1daa3ec6c920fa9e /test-fff.scm
parentMake fff-parse.scm the actual thing (diff)
downloadfff-d7d4e2c94adc91d8bcc5647174d74514aa23df12.tar.gz
fff-d7d4e2c94adc91d8bcc5647174d74514aa23df12.zip
Add header and change perms
Diffstat (limited to 'test-fff.scm')
-rw-r--r--test-fff.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/test-fff.scm b/test-fff.scm new file mode 100644 index 0000000..f1cf746 --- /dev/null +++ b/test-fff.scm
@@ -0,0 +1,23 @@
1(use-modules (ice-9 format)
2 (ice-9 peg)
3 (ice-9 textual-ports)
4 (fff))
5
6(define (read-file file)
7 (call-with-input-file file get-string-all))
8
9(define (test-parse input)
10 (let loop ((str "")
11 (num 0)
12 (lst (string-split input #\newline)))
13 (cond
14 ((null? lst) (match-pattern fff str))
15 ((not (match-pattern fff str))
16 (format #t "!!!!!!!!!!!!!!!!!!!!!!!~%~s~%" lst))
17 (else
18 (format #t "~s~%~%" (peg:tree (match-pattern fff str)))
19 (when (match-pattern fff str)
20 (format #t "~s~%" (car lst)))
21 (loop (string-append str "\n" (car lst))
22 (+ num 1)
23 (cdr lst))))))