Closed AlexKnauth closed 9 years ago
Yes, I believe so. And I agree that currying is a good approach.
Ok, I changed it to use the currying approach with make-scribble-lexer and make-scribble-inside-lexer.
Bumped version, added tests, added docs, and merged. As it turns out, my first test was to use #+ as the character, which broke some of the regexp constructions. I adjusted those constructions.
Oh, I hadn't thought of that. But shouldn't it use regexp-quote
instead to do that?
Otherwise won't it break for \
and ^
for example? (and probably others I haven't thought of yet)
I didn't think to try those; \
seems to work and ^
fails. More tests and repairs would be welcome!
I didn't use regexp-quote
because I thought that it would be more complicated than dropping characters into "[...]", but I think I chose badly.
@robby: Do I remember correctly that DrRacket's syntax colorer will call
scribble-lexer
multiple times, so that the regular expressions here would be compiled multiple times with the additional argument? If so, I think it makes sense to add amake-scribble-lexer
layer, wherescribble-lexer
is the result of calling that function with#\@
, and so on.