Bug 389693 - Support C++11 user-defined number literals
Summary: Support C++11 user-defined number literals
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: 5.42.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-31 14:26 UTC by Benjamin Buch
Modified: 2018-07-23 21:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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