rename some identifiers

pull/10/head
Matthew Butterick 8 years ago
parent e054cc1273
commit 6c3c0940ad

@ -3,16 +3,21 @@
(provide basic-colorer)
(define (basic-colorer port)
(define (handle-lexer-error exn)
(define exn-srclocs (exn:fail:read-srclocs exn))
(srcloc-token (token 'ERROR) (car exn-srclocs)))
(define srcloc-tok (with-handlers ([exn:fail:read? handle-lexer-error])
(basic-lexer port)))
(define (handle-lexer-error excn)
(define excn-srclocs (exn:fail:read-srclocs excn))
(srcloc-token (token 'ERROR) (car excn-srclocs)))
(define srcloc-tok
(with-handlers ([exn:fail:read? handle-lexer-error])
(basic-lexer port)))
(match srcloc-tok
[(? eof-object?) (values srcloc-tok 'eof #f #f #f)]
[else
(match-define (srcloc-token (token-struct type val _ _ _ _ _)
(srcloc _ _ _ pos span)) srcloc-tok)
(match-define
(srcloc-token
(token-struct type val _ _ _ _ _)
(srcloc _ _ _ posn span)) srcloc-tok)
(define start posn)
(define end (+ start span))
(match-define (list cat paren)
(match type
['STRING '(string #f)]
@ -24,4 +29,4 @@
["(" '(parenthesis |(|)]
[")" '(parenthesis |)|)]
[else '(no-color #f)])]))
(values val cat paren pos (+ pos span))]))
(values val cat paren start end)]))
Loading…
Cancel
Save