Generally speaking, is there a way I can peak under the hood to see what the lexer is doing for Python? I'm confused by some things. Specifically, I don't understand how to turn brace matching off, nor what all the different properties that involve braces do.
I commented out all of the following: braces.check=1 braces.sloppy=1 # Operators style.python.10=bold # Matched Operators style.python.34=fore:#0000FF,bold style.python.35=fore:#FF0000,bold # Braces are only matched in operator style braces.python.style=10 Yet still brace matching was working! I'm not sure if this is a bug or if there are more options to change. Thanks, John On 8/17/06, John Salerno <[EMAIL PROTECTED]> wrote:
Thank you! That works great! Just one more quick question. I also noticed another style entry like this: # Identifiers style.python.11= What is this one for? Is this also customizable, since it has no settings yet? Thanks, John On 8/16/06, Robert Roessler <[EMAIL PROTECTED]> wrote: > John Salerno wrote: > > Thanks. But the only list I see in the Python lexer is the list of > > actual Python keywords. I assume method and function names are read > > from the API file. > > > > But what if I want to add additional words to highlight that are not > > keywords? The two examples I gave, for instance, are 'self' and > > exception names, neither of which are keywords and both of which I'd > > like to highlight differently than keywords. So is there a way for me > > to define new lists of words, such as one for exceptions? > > The C++ code of a lexer says how many keyword lists are defined/used > by that lexer - so adding a new list just by changing the .properties > file is not going to happen *in general*. > > Internally, a generic lexer will do tokenizing based on the rules of > that language. When it has identified a token that *could* be a > "keyword" in that language, it will typically check this against the > various "keyword" lists from its .properties file. > > This is the sense of the "keywords" we are talking about here - which > may or may not bear a close resemblance to the "keywords" defined by a > language's grammar. This process can also be somewhat different from > what I have described, e.g., because of rules about shortest/longest > matching etc. > > Anyway, if the .properties file already has a "keyword" list that > matches what you want in terms of appearance (font, color, weight), > and your desired new entry *could* be in that list based on the > tokenizing rules, then adding to that list will probably work. > > But I think this is about the limit of what you can do without hacking > said lexer to define *new* keyword lists. YMMV. > > As it happens, the Python lexer seems to define an additional keyword > class it refers to as "Highlighted identifiers"... to use this, just > edit your python.properties and add something like > > keywords2.$(file.patterns.py)=self MyException > > Note that this will use style# 14 for coloring info when the tokens > self or MyException are encountered in Python source. > > Since Neil is "Mr Python" around here, he might have other comments to > add regarding the intended use of this feature of the Python lexer. > > Robert Roessler > [EMAIL PROTECTED] > http://www.rftp.com > _______________________________________________ > Scite-interest mailing list > [email protected] > http://mailman.lyra.org/mailman/listinfo/scite-interest >
_______________________________________________ Scite-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scite-interest
