Bug 389693

Summary: Support C++11 user-defined number literals
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Benjamin Buch <benni.buch>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: benni.buch
Priority: NOR    
Version First Reported In: 5.42.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Benjamin Buch 2018-01-31 14:26:17 UTC
The C++ and ISO C++ highlighting styles mark C++11 user-defined literals errors.

Reproducible: Always

Steps to Reproduce:
1. Type 1s 2min 3h 4.4_meter into a file
2. Set the highlighting mode to C++ or ISO C++

See
http://en.cppreference.com/w/cpp/language/user_literal
for more examples.

Actual Results:  
The number are highlighted as errors

Expected Results:  
The numbers are highlighted as user-defined literals.
Comment 1 Benjamin Buch 2018-01-31 14:31:24 UTC
user-defined literals with an underscore after an integer are already supported:

3_min   // Works
3.3_min // The part after the underscore is separately highlighted, not optimal
3min    // Error
3.3min  // The part after the underscore is not highlighted
Comment 2 Jonathan Poelen 2018-07-23 21:21:16 UTC
Git commit 7a2ae6be229b9df45807b134db9cd0c24c3da671 by Jonathan Poelen.
Committed on 23/07/2018 at 21:23.
Pushed by jpoelen into branch 'master'.

C++: fix standard floating-point literals

Summary: BUG: 389693

Reviewers: #framework_syntax_highlighting, dhaumann

Reviewed By: #framework_syntax_highlighting, dhaumann

Subscribers: kde-frameworks-devel, kwrite-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D14283

M  +4    -0    autotests/folding/highlight.cpp.fold
M  +4    -0    autotests/html/highlight.cpp.html
M  +4    -0    autotests/input/highlight.cpp
M  +4    -0    autotests/reference/highlight.cpp.ref
M  +3    -0    data/syntax/isocpp.xml

https://commits.kde.org/syntax-highlighting/7a2ae6be229b9df45807b134db9cd0c24c3da671