Re: [racket-users] how to attach lexer to a color:text% in DrRacket

2016-10-07 Thread Matthew Butterick
On Oct 7, 2016, at 9:47 AM, Robby Findler wrote: > For just running examples and looking at their output, a simpler way > is probably to use codeblock-pict from the pict/code library. That > requires you to set up your lexer as a module lexer, but doesn't have > the disadvantage that you have to r

Re: [racket-users] how to attach lexer to a color:text% in DrRacket

2016-10-07 Thread Robby Findler
For testing your lexer, I think you probably want to write a helper function that takes in a lexer and a port and returns a list of tokens and then go from there. There is one such here (the lex function): https://github.com/racket/syntax-color/blob/master/syntax-color-test/tests/syntax-color/modu

[racket-users] how to attach lexer to a color:text% in DrRacket

2016-10-07 Thread Matthew Butterick
Suppose I want to test `my-lexer` as a DrRacket syntax colorer. My idea is to create a miniature editor with `color-text%` and display it in DrRacket with `editor-snip%`. The code below will display a basic editor with black text. Q: How can I attach `my-lexer` to this editor so that the text i