[plt-scheme] Highlighting Scheme Code
At Thu, 5 Mar 2009 15:53:53 +0000, "Paulo J. Matos" wrote:
> Hi all,
>
> I would like to have a function that highlights scheme code. I know
> about code from slideshow but that highlights the code and returns a
> pict. I need, once the code is highlighted, the color of each
> character.
>
> I think it is possible to do this given that drscheme itself has
> probably to do this somehow since it has to highlight the code and
> display the character on screen with the appropriate color, but how
> does it do?
Re-using DrScheme's syntax colorer is probably the right idea. The
library is `syntax-color/scheme-lexer'.
Aside from the documentation, you might look at the library's test
suite to get ideas on using it:
http://svn.plt-scheme.org/plt/trunk/collects/tests/syntax-color/scheme-lexer.ss