<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Ok the last mystery is how can I control the pair matching and
colors that lexemes should have? If I call `start-colorer' on the
color:text% I can pass in the style function and the list of
matching lexemes but with the module-reader I only have control over
the lexer via #:info.<br>
<br>
Currently I have<br>
<br>
(define (style what)<br>
(case what<br>
[(number) "framework:syntax-color:scheme:constant"]<br>
[(string) "framework:syntax-color:scheme:string"]<br>
[(identifier) "framework:syntax-color:scheme:symbol"]<br>
[(parens) "framework:syntax-color:scheme:parenthesis"]<br>
[else "Standard"]))<br>
<br>
(define pairs '([ |(| |)| ]<br>
[ |[| |]| ]<br>
[ |{| |}| ]<br>
))<br>
<br>
And although my current `pairs' list matches what the
text-mode-mixin has I may add things to the list in the future.<br>
<br>
On 08/02/2011 10:56 AM, Robby Findler wrote:
<blockquote
cite="mid:CAL3TdOOFyWObGa4+s=EP=7grvvnp-=0xq4e2ZEWYAeCBhGhoAA@mail.gmail.com"
type="cite">No. It should back up to the previous lexeme and start
there. <br>
<br>
Robby<br>
<br>
On Tuesday, August 2, 2011, Jon Rafkind <<a
moz-do-not-send="true" href="mailto:rafkind@cs.utah.edu">rafkind@cs.utah.edu</a>>
wrote:<br>
> On 08/01/2011 06:40 PM, Matthew Flatt wrote:<br>
>> At Mon, 01 Aug 2011 18:13:11 -0600, Jon Rafkind wrote:<br>
>>> How do I deal with partial lexemes when using the
color:text colorer? It<br>
>>> seems that if my lexer cannot produce a valid token
then it will throw<br>
>>> an error and the color thread will keep calling
`get-token' in a busy loop.<br>
>>><br>
>>> Is there some magic thing I can return from
`get-token' to tell the<br>
>>> colorer that it should not progress to the next
position?<br>
>> A coloring lexer's job is to never fail. It should
instead categorize<br>
>> bad input as 'error and be ready to continue.<br>
>><br>
>> Continuing can mean categorizing all further input as
'error, but it's<br>
>> usually better to continue in some other way.<br>
>><br>
><br>
> It seems the colorer re-tokenizes the entire input stream
each time I<br>
> enter a character. Is that the expected behavior?<br>
> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a moz-do-not-send="true"
href="http://lists.racket-lang.org/listinfo/users">http://lists.racket-lang.org/listinfo/users</a><br>
>
</blockquote>
<br>
</body>
</html>