[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Default Styles in KF5
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2014-02-21 21:43:36
Message-ID: le8h9q$5pn$1 () ger ! gmane ! org
[Download RAW message or body]

On 2014-02-21 15:57, Philipp A. wrote:
> 2014-02-21 0:49 GMT+01:00 Sven Brauch:
>> With the current setup, I don't see a need for dsBuiltin personally. For the
>> bash example, couldn't you use dsFunction for all the commands? That seems
>> pretty logical to me. Also in python I think everything is covered with
>> dsConstant, dsFunction and dsKeyword. dsBuiltin would be a subset of things
>> that fit into dsConstant and dsFunction.
>
> As Matthew said:
>
>     dsFunction is def foo(arguments): (foo) as well as bar.baz() (baz)

Actually, Python doesn't seem to highlight that right now. Maybe it 
should? (But then we *would* need a dsBuiltin at least; see below.)

>     dsLanguageConstant is True, False,None,Ellipsis`
>
>     dsConstant is derived from convention: EVERYTHING_CAPS_WITH_UNDERSCORES
>
>     dsBuiltin is functions like open, enumerate, range and types like set,
>     dict, and special methods like __bool__, __lt__
>
> The last one is arguably the most useful, as you'll see immediately if you
> e.g. wrote def __str_(self): instead of using two underscores at the end.

> And distinguishing between dsLanguageConstant and dsConstant might not be
> necessary. normal constants would be that style and all-caps, while
> language constants are that style and *not* all caps.

dsLanguageConstant isn't in the proposal, is it? :-)

So, now that you've inspired me to do the "thought exercise" for 
python.xml...

Normal Text -> dsNormal
Definition Keyword -> dsKeyword or dsDataType (+ bold?)
Command Keyword -> dsKeyword
Flow Control Keyword -> dsControlFlow
Operator -> dsOperator

Builtin Function -> dsDataType
Extensions -> dsExtension
Overloaders -> dsFunction (or dsBuiltin?)
Decorator -> dsAnnotation
Special Variable -> dsVariable
Exceptions -> dsConstant

Preprocessor -> dsOther

Float -> dsFloat
Int -> dsDecVal
Hex, Octal -> dsBaseN
Complex -> dsOther

String -> dsString
String Char -> dsChar
String Substitution -> dsSpecialChar ¹
Raw String -> dsVerbatimString ²

Comment -> dsComment
Docstring -> dsDocumentation (note: only in my local python.xml)

...I think we are actually okay for Python without a dsBuiltin, but it 
wouldn't hurt us to have one.

( ¹ Yeah... really want dsSpecialChar back, please! This is an excellent 
example use case for it.)

( ² ...maybe drop the 'String' from this name, and use for e.g. code 
blocks in doxygen / reST?)

-- 
Matthew

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic