From cc016fe9fc694c291a2f256aa20c1628022db8ca Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 30 Jan 2011 08:57:38 -0600 Subject: [PATCH] started to fix the colorer problems (now that I undestand how!) plus some extra checking in the colorer original commit: 49c3011f49caae37a496a25d482e5b8855def3ee --- collects/framework/private/color.rkt | 8 ++++++++ 1 file changed, 8 insertions(+) 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)))