(define (match-symbol input pattern)
(cond ((null? (remain input)) #f)
((eqv? (car (remain input)) pattern) (r-cdr input))
(else #f)))
(define (match-or input pattern)
(cond ((null? pattern) #f)
((match-pattern input (car pattern)))
(else (match-or input (cdr pattern)))))
(define (match-seq input pattern)
(if (null? pattern)
input
(let ((match (match-pattern input (car pattern))))
(if match (match-seq match (cdr pattern)) #f))))
(define (match-opt input pattern)
(let ((match (match-pattern input (car pattern))))
(if match match input)))
(define (match-any input pattern)
(cond ((null? (remain input)) #f)
((null? pattern) (f-cons (remain input) (clear-remain input)))
(else