Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318950

Summary: Add support for di- and trigraphs
Product: [Tools] CDT Reporter: Ted Shaneyfelt <shaneyfelt>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: enhancement    
Priority: P3 CC: dibalavs
Version: 7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Ted Shaneyfelt CLA 2010-07-05 22:05:09 EDT
Build Identifier: M20100211-1343

Trigraphs should work identically to their respective equivalent characters:

ANSI C standard states in section 2.2.1.1 Trigraph sequences that

   "All occurrences in a source file of the following sequences of
three characters (called trigraph sequences) are replaced with the
corresponding single character.

         ??=      #
         ??(      [
         ??/      \
         ??)      ]
         ??'      ^
         ??<      {
         ??!      |
         ??>      }
         ??-      ~
"


Reproducible: Always

Steps to Reproduce:
1.Enter code opening a block of code with trigraphs   ??<   or  ??(   in place of   {   or   [   respectively
2.Close the blocks using trigraphs  ??>   or   ??)   on a following line in place of   }   or   ]   respectively
3.Edit -> Format

The indentation in the code does not properly line up.
Comment 1 Anton Leherbauer CLA 2010-11-02 03:47:46 EDT
*** Bug 329154 has been marked as a duplicate of this bug. ***
Comment 2 Ted Shaneyfelt CLA 2014-02-15 19:21:01 EST
(In reply to Anton Leherbauer from comment #1)
> *** Bug 329154 has been marked as a duplicate of this bug. ***

Although both bugs have to do with trigraphs, the highlighting of that bug and the indentation of this bug are not necessarily the same bug, depending on how it gets fixed. 

Another note: You should also look at digraphs for C++, as well as trigraphs.

for  [ ]  digraphs  <:  :>   in addition to trigraphs   ??(    ??)
for  { }  digraphs  <%  %>   in addition to trigraphs   ??<    ??>
for  #    digraph   %:       in addition to trigraph    ??=
for  ##   the double-digraph  %:%: