(use-modules (ice-9 format) (ice-9 peg) (ice-9 textual-ports) (fff)) (define (read-file file) (call-with-input-file file get-string-all)) (define (test-parse input) (let loop ((str "") (num 0) (lst (string-split input #\newline))) (cond ((null? lst) (match-pattern fff str)) ((not (match-pattern fff str)) (format #t "!!!!!!!!!!!!!!!!!!!!!!!~%~s~%" lst)) (else (format #t "~s~%~%" (peg:tree (match-pattern fff str))) (when (match-pattern fff str) (format #t "~s~%" (car lst))) (loop (string-append str "\n" (car lst)) (+ num 1) (cdr lst))))))