;; generated automatically.  DO NOT EDIT
#!no-fold-case
(define-module parser.peg (use srfi-1) (use srfi-13) (use srfi-14) (use gauche.collection) (use util.list) (use util.match) (export make-peg-stream string->peg-stream port->peg-stream list->peg-stream peg-stream-peek! peg-stream-position <parse-error> make-peg-parse-error peg-run-parser peg-parse-string peg-parse-port $return $fail $expect $do $do* $<< $try $seq $or $fold-parsers $fold-parsers-right $many $many1 $skip-many $repeat $optional $alternate $sep-by $end-by $sep-end-by $count $between $not $many-till $chain-left $chain-right $lazy $s $c $y $string $string-ci $char $one-of $none-of $many-chars $satisfy anychar upper lower letter alphanum digit hexdigit newline tab space spaces eof $->rope rope->string rope-finalize))
(select-module parser.peg)
(dynamic-load "parser--peg")
(define-syntax $lazy (syntax-rules () ((_ parse) (let ((p (delay parse))) (lambda (s) ((force p) s))))))
(define-syntax $satisfy (syntax-rules (cut <>) ((_ (cut p x <>) expect) (lambda (s) (if (and (peg-stream-peek! s) (p x (car s))) (return-result (car s) (cdr s)) (return-failure/expect expect s)))) ((_ pred expect) (lambda (s) (if (peg-stream-peek! s) (if (pred (car s)) (return-result (car s) (cdr s)) (return-failure/expect expect s)) (return-failure/expect expect s))))))
(define-syntax $many-chars (syntax-rules () ((_ parser) ($many ($one-of parser))) ((_ parser min) ($many ($one-of parser) min)) ((_ parser min max) ($many ($one-of parser) min max))))
