*** empty log message ***

original commit: 9dc3a841acf4b79c4e080f290177d76ac0dd1c7a
This commit is contained in:
Scott Owens 2004-12-12 03:43:23 +00:00
parent 1df120f426
commit f18cbe8de0

View File

@ -177,9 +177,10 @@
(define/private (re-tokenize in in-start-pos enable-suspend) (define/private (re-tokenize in in-start-pos enable-suspend)
(let-values ([(lexeme type data new-token-start new-token-end) (let-values ([(lexeme type data new-token-start new-token-end)
(get-token in)]) (get-token in)])
;(printf "~a~n" lexeme)
(unless (eq? 'eof type) (unless (eq? 'eof type)
(enable-suspend #f) (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)))
(let ((len (- new-token-end new-token-start))) (let ((len (- new-token-end new-token-start)))
(set! current-pos (+ len current-pos)) (set! current-pos (+ len current-pos))
(sync-invalid) (sync-invalid)
@ -251,16 +252,19 @@
(define/private (colorer-driver) (define/private (colorer-driver)
(unless up-to-date? (unless up-to-date?
#;(printf "revision ~a~n" (get-revision-number))
(unless (and tok-cor (= rev (get-revision-number))) (unless (and tok-cor (= rev (get-revision-number)))
(when tok-cor (when tok-cor
(coroutine-kill tok-cor)) (coroutine-kill tok-cor))
#;(printf "new coroutine~n")
(set! tok-cor (set! tok-cor
(coroutine (coroutine
(lambda (enable-suspend) (lambda (enable-suspend)
(re-tokenize (open-input-text-editor this current-pos end-pos (parameterize ((port-count-lines-enabled #t))
(re-tokenize (open-input-text-editor this current-pos end-pos
(lambda (x) #f)) (lambda (x) #f))
current-pos current-pos
enable-suspend)))) enable-suspend)))))
(set! rev (get-revision-number))) (set! rev (get-revision-number)))
(with-handlers ((exn:fail? (with-handlers ((exn:fail?
(lambda (exn) (lambda (exn)
@ -269,12 +273,16 @@
(format "exception in colorer thread: ~s" exn) (format "exception in colorer thread: ~s" exn)
exn)) exn))
(set! tok-cor #f)))) (set! tok-cor #f))))
#;(printf "begin lexing~n")
(when (coroutine-run 10 tok-cor) (when (coroutine-run 10 tok-cor)
(set! up-to-date? #t))) (set! up-to-date? #t)))
#;(printf "end lexing~n")
(unless (null? colors) (unless (null? colors)
#;(printf "begin coloring~n")
(begin-edit-sequence #f #f) (begin-edit-sequence #f #f)
(color) (color)
(end-edit-sequence)))) (end-edit-sequence)
#;(printf "end coloring~n"))))
(define/private (colorer-callback) (define/private (colorer-callback)
(cond (cond