| Summary: | Digraphs and trigraphs in C and C++ are not handled correctly | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | loic.damien |
| Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | nibgonz |
| Priority: | NOR | ||
| Version First Reported In: | 5.61.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/syntax-highlighting/364ed572e2ec89c090c1c19dab8eab6a02518d46 | Version Fixed/Implemented In: | 5.62.0 |
| Sentry Crash Report: | |||
|
Description
loic.damien
2019-09-01 21:11:23 UTC
Digraphs can be easily added.
The trigraphs were removed in C++17 and are almost in disuse in C, do you think it is necessary to add them also to the C highlighter? For example, at least, the folding of ??< and ??> (equivalent to { and }).
Proposed patch: https://phabricator.kde.org/D23691 Git commit 364ed572e2ec89c090c1c19dab8eab6a02518d46 by Christoph Cullmann, on behalf of Nibaldo González.
Committed on 03/09/2019 at 16:46.
Pushed by cullmann into branch 'master'.
C & ISO C++: add digraphs (folding & preprocessor)
Summary:
**ISO C ++**
* Add folding for digraphs `<%`, `%>`, `<:` and `:>`, which are equivalent to `{`, `}`, `[` and `]`.
* Fix the highlight of `%:` in preprocessor, for example, `%:include <some>`.
**C**
* Add folding for digraphs `<%` and `%>`, which are equivalent to `{` and `}`.
* Add `%:` equivalent to `#` in preprocessor.
Trigraphs were removed in C++17 and are supported in C (if activated in the compiler), but are almost obsolete. That's why I decided not to add them. Although if you wish I can add folding to `??<` and `??>`, which are equivalent to `{` and `}`.
**More:**
* https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C
Reviewers: #framework_syntax_highlighting, dhaumann, cullmann
Reviewed By: #framework_syntax_highlighting, cullmann
Subscribers: kwrite-devel, kde-frameworks-devel
Tags: #kate, #frameworks
Differential Revision: https://phabricator.kde.org/D23691
M +8 -0 autotests/folding/highlight.cpp.fold
M +9 -0 autotests/folding/test.c.fold
M +8 -0 autotests/html/highlight.cpp.html
M +9 -0 autotests/html/test.c.html
M +8 -0 autotests/input/highlight.cpp
M +9 -0 autotests/input/test.c
M +8 -0 autotests/reference/highlight.cpp.ref
M +9 -0 autotests/reference/test.c.ref
M +21 -16 data/syntax/c.xml
M +9 -4 data/syntax/isocpp.xml
https://commits.kde.org/syntax-highlighting/364ed572e2ec89c090c1c19dab8eab6a02518d46
|