racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
454 stars 93 forks source link

Documentation of list of recognized syntax-coloring token types/styles is incomplete #380

Open gfbee opened 4 years ago

gfbee commented 4 years ago

https://github.com/racket/drracket/blob/7ae87809bc2e7d5849f27dd3689f837cd4c7ade9/drracket/scribblings/tools/lang-tools.scrbl#L62-L72

(map first (racket:get-color-prefs-table)) shows 'text and 'hash-colon-keyword are missing, which if included match the ten that have entries in the “Color / Racket” preferences tab. That table is hard-coded (and the preferences tab derived from it) : https://github.com/racket/gui/blob/0fbbf759d3f244458378a639f653971fdff76668/gui-lib/framework/private/racket.rkt#L294

An 'sexp-comment token (a parsed “#;” in the racket lexer) is also styled, as a 'comment : https://github.com/racket/gui/blob/0fbbf759d3f244458378a639f653971fdff76668/gui-lib/framework/private/racket.rkt#L335-L349

A 'white-space token is styled as 'parenthesis, which presumably has no visible effect if the lexer only produces that for invisible lexemes with invisible glyphs. Not changing styles at the boundary is to reduce memory usage : https://github.com/racket/gui/commit/2da0f724923b300ab98a508018604f7d71863d62

Some 'symbol tokens get translated to 'keyword tokens based on the “Editing / Indenting” prefs, which affects their coloring : https://github.com/racket/gui/blob/0fbbf759d3f244458378a639f653971fdff76668/gui-lib/framework/private/racket.rkt#L1376-L1431