On Wed, Aug 27, 2008 at 12:32 AM, Jeff Wheeler <[EMAIL PROTECTED]> wrote:
>> This is exactly what we do. See eg. Yi.Syntax.Paren.getStrokes
>
> Hmm, when is this used? I was under the impression that the lexer
> actions indicated to Yi what style should be used, and this was all
> that happened. E.g., in the Python lexer, there is [EMAIL PROTECTED] { c
> keywordStyle }`, which seems to the exact style name used when
> highlighting (`keywordStyle` is used in the Yi.Style.Library style
> definitions). It seems, then, that the styles aren't working with a
> parsed file, but the direct output of Alex: just a token stream,
> right?True for "quick and dirty" highlighters. The "clever ones" (for now think of Yi.Mode.Haskell.cleverMode / Yi.Syntax.Paren) add this syntax-level pass. > Yi.IncrementalParsing seems to do a lot of the right stuff, but I'm > not sure how this is used currently. It looks like Yi may be using > this with the lexing, although I'm not exactly sure how this > integrates with Alex. Alex generates a token stream that can then be processed (eg. on syntax level) > To me, the styles in Yi.Styles.Library should be referencing the > hierarchy, not token names. A style might define "source > haskell > > function > name" to a certain color, or "source > function > name", > "function > name", or even just "name" to apply to all function names, > variable names, etc. That's an interesting point of view, but I'm not sure how to achieve such a level of customization at the moment. For now all languages are required to use the same theme (which to me is the right thing to do). I'm still unsure what you want. Is it any of the following? 1. One should not be required to give definitions for each specific field in the UIStyle type. Suitable defaults should be inferred for unspecified values. 2. Writers of lexers should not be required to assign a style for each token. "Broad" highlighting should be possible too. 3. The UIStyle type is too haskell-specific and should provide more styles, for usage by other languages. > Ah, I wrote the Python lexer. :) Oops, blunder... :p Sorry about the confusion. Corey wrote the Perl one. (maybe?) Cheers, JP. --~--~---------~--~----~------------~-------~--~----~ Yi development mailing list [email protected] http://groups.google.com/group/yi-devel -~----------~----~----~----~------~----~------~--~---
