C++: update for c++20 and fix some syntax errors
ClosedPublic

Authored by jpoelen on Jun 7 2018, 12:05 AM.

Details

Summary
  • new keywords, attributes and standard macros
  • hexadecimal floatting point (c++17)
  • highlight UDL (standard and user)
  • fix some syntax error (operator""_x, #elif 0, ...)
  • highlight the content of #define to the color of c++

I changed the highlight in the #define to use the color of the code (In Define rule). Only the "normal" text is the color of the preprocessor.

Before:

After:

Diff Detail

Repository
R216 Syntax Highlighting
Branch
cpp
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 60
Build 60: arc lint + arc unit
jpoelen created this revision.Jun 7 2018, 12:05 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJun 7 2018, 12:05 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
jpoelen requested review of this revision.Jun 7 2018, 12:05 AM
jpoelen edited the summary of this revision. (Show Details)Jun 7 2018, 12:17 AM
jpoelen added a reviewer: dhaumann.

To be honest, I cannot claim I can follow all changes, since this is a big update. But in general the usage of the rules look good.

The autotest output (html highlighting) looks good to me, it contains nice improvements for C++14 and C++17.

@cullmann Since this is a big one, can you test this as well? Would be nice to have some days of testing for this.

data/syntax/gcc.xml
576–577

These can be WordDetect as well, right?

jpoelen updated this revision to Diff 36229.Jun 16 2018, 3:05 PM
  • C++: test with clang:: in an attribute

Will take a look ;=)

cullmann accepted this revision.Jun 17 2018, 3:27 PM

Looks good for me!
Thanks for the improvements.

This revision is now accepted and ready to land.Jun 17 2018, 3:27 PM
jpoelen added inline comments.Jun 18 2018, 10:13 PM
data/syntax/gcc.xml
576–577

It does not work because of ':'. But Putting it in weakDeliminator will break things.
For this to work, it would need additionalDeliminator and weakDeliminator attributes for WordDetect (and Keyword).

@jpoelen Can you push yourself, or do you still not have a KDE contributor account?

I do not have a developer account, but I can do it. This is not a problem because I will contribute again.

To get this in, I will push it for you.
If you need some reason for a developer account, you can just link this request.

Restricted Application added a project: Kate. · View Herald TranscriptJul 14 2018, 5:08 PM
Restricted Application added a subscriber: kwrite-devel. · View Herald Transcript
This revision was automatically updated to reflect the committed changes.

Thank you, but I already made the request and it was accepted last night. I will do the next push :)