forgot to add this file in my previous commit
This commit is contained in:
parent
d25cbed6c0
commit
40363da511
34
collects/syntax-color/lexer-contract.rkt
Normal file
34
collects/syntax-color/lexer-contract.rkt
Normal 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))))))
|
Loading…
Reference in New Issue
Block a user