forgot to add this file in my previous commit

This commit is contained in:
Robby Findler 2013-02-23 19:50:03 -06:00
parent d25cbed6c0
commit 40363da511

View File

@ -0,0 +1,34 @@
#lang racket/base
(require racket/contract/base
unstable/options)
(provide lexer/c)
(define lexer/c
(option/c
(or/c (->i ([in input-port?])
(values [txt any/c]
[type symbol?]
[paren (or/c symbol? #f)]
[start (or/c exact-positive-integer? #f)]
[end (start)
(if start
(and/c exact-positive-integer?
(>=/c start))
#f)]))
(->i ([in input-port?]
[offset exact-nonnegative-integer?]
[mode any/c])
(values [txt any/c]
[type symbol?]
[paren (or/c symbol? #f)]
[start (or/c exact-positive-integer? #f)]
[end (start)
(if start
(and/c exact-positive-integer?
(>=/c start))
#f)]
[backup exact-nonnegative-integer?]
[new-mode any/c])))
#:tester (λ (x) (and (procedure? x)
(or (procedure-arity-includes? x 1)
(procedure-arity-includes? x 3))))))