diff --git a/collects/framework/private/color.rkt b/collects/framework/private/color.rkt index 365c48f0..1ade5b4e 100644 --- a/collects/framework/private/color.rkt +++ b/collects/framework/private/color.rkt @@ -297,6 +297,14 @@ added get-regions (get-token in in-start-pos in-lexer-mode) (enable-suspend #t)))]) (unless (eq? 'eof type) + (unless (exact-nonnegative-integer? new-token-start) + (error 'color:text<%> "expected an exact nonnegative integer for the token start, got ~e" new-token-start)) + (unless (exact-nonnegative-integer? new-token-end) + (error 'color:text<%> "expected an exact nonnegative integer for the token end, got ~e" new-token-end)) + (unless (exact-nonnegative-integer? backup-delta) + (error 'color:text<%> "expected an exact nonnegative integer for the backup delta, got ~e" backup-delta)) + (unless (0 . < . (- new-token-end new-token-start)) + (error 'color:text<%> "expected the distance between the start and end position for each token to be positive, but start was ~e and end was ~e" new-token-start new-token-end)) (enable-suspend #f) #; (printf "~a at ~a to ~a\n" lexeme (+ in-start-pos (sub1 new-token-start)) (+ in-start-pos (sub1 new-token-end)))