[racket] [help] : Syntax coloration

From: Gustavo Massaccesi (gustavo at oma.org.ar)
Date: Tue Dec 2 08:27:11 EST 2014

Are you  sure you need to implement a new-canvas%? I think you only
have to do that if you need some king of custom editing capabilities.

(I don't have a good example now. Perhaps an editor that understand
the indentation rules of the old Fortran fixed-form format, where the
first 6 characters have special meaning. When you hit enter, you must
jump to the correct position, that is different from the standard
position.)

Usually you only need to create a new #lang:
http://docs.racket-lang.org/guide/hash-languages.html and then you can
customize the standard editor to adapt the syntax highlighting.

Gustavo


On Mon, Dec 1, 2014 at 9:00 PM, Stephen De Gabrielle
<spdegabrielle at gmail.com> wrote:
> I don't *do* languages in racket, but I think this may be a helpful part of
> the documentation:
> http://docs.racket-lang.org/syntax-color/index.html
> Stephen
>
>
>
> On Mon Dec 01 2014 at 9:35:14 PM Florent PASTOR <flopastor06 at gmail.com>
> wrote:
>>
>> Hello,
>> I am a french student and I have to do a project for my studies...
>> The project is a compilator from a lambda language to racket.
>>
>> I use the racket/gui and i defined an editor-canvas% to write in my
>> lambda language. I would like implement the syntax coloring for my
>> language.
>> To do this, I re defined the on-char method ( define/override ) but,
>> when i write now on my keyboard, the text doesn't appear in my
>> editor-canvas%....
>> Is it possible to just add at the end of the function on-char (without
>> changing the on-char), a new function called "color-key" (for example)
>> (previously defined by me) to coloring the text just insered ?
>>
>> Thank you very much
>> Best regards
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>

Posted on the users mailing list.