GOOPS cosmetics
[bpt/guile.git] / test-suite / tests / peg.bench
index 3b3716f..7baad5c 100644 (file)
 (define parse-product (make-left-parser parse-value))
 (define parse-sum (make-left-parser parse-product))
 (define parse-expr parse-sum)
-(define (eq-parse str) (apply parse-expr (peg:tree (peg-parse expr str))))
+(define (eq-parse str) (apply parse-expr (peg:tree (match-pattern expr str))))
 
 ;; PEG for parsing equations (see tutorial).
-(define-grammar
+(define-peg-string-patterns
   "expr <- sum
 sum <-- (product ('+' / '-'))* product
 product <-- (value ('*' / '/'))* value
@@ -141,7 +141,7 @@ sp < [ \t\n]*")
             (lambda (x)
               (let* ((mstr (string-n tst1 x))
                      (strlen (string-length mstr)))
-                (let ((func (lambda () (begin (peg-parse expr mstr)
+                (let ((func (lambda () (begin (match-pattern expr mstr)
                                               'done))))
                   `(((string of length ,strlen first pass)
                      ,(time-ret-func func))
@@ -170,4 +170,4 @@ sp < [ \t\n]*")
 (define (lisp-calc str)
   (+ (eval (eq-parse str) (interaction-environment)) 0.0))
 
-;; (pretty-print `(,(sys-calc tst1) ,(lisp-calc tst1)))
\ No newline at end of file
+;; (pretty-print `(,(sys-calc tst1) ,(lisp-calc tst1)))