Menu

#607 Update C++ mode

None
closed-accepted
None
5
2018-02-10
2015-01-19
ahlearn
No

Hi,

Could you please update the C++ mode to support C++11/14?
For example, "override" and "auto" are keywords.

Thanks,
AhLeung

Discussion

  • Dale Anson

    Dale Anson - 2015-08-08

    I haven't done any serious C work in years. Are there other new key words? I've read that there are now binary literals and that long numbers can have separators to make them easier to read. What else is there that would affect syntax highlighting?

     
  • ahlearn

    ahlearn - 2015-08-08

    There are four new string literals introduced: http://en.cppreference.com/w/cpp/language/string_literal
    I think the first three are easy to implement, but I don't know how to implement the last one (raw string literal, e.g., R"foo(Hello World)foo") using jedit mode.

     

    Last edit: ahlearn 2015-08-08
  • Roman Tsourick

    Roman Tsourick - 2017-11-23

    Added a bunch of keywords along with new literals. I would appreciate if someone could test it.

     
  • Alan Ezust

    Alan Ezust - 2017-11-23
    • assigned_to: Alan Ezust
     
  • Alan Ezust

    Alan Ezust - 2017-11-23

    Ticket moved from /p/jedit/feature-requests/497/

     
  • Alan Ezust

    Alan Ezust - 2017-12-03

    Roman, you know more about edit modes than I do now.
    Any ideas on how to do that last kind of multiline quote?

    #include <iostream>
    
    char array1[] = "Foo" "bar";
    // same as
    char array2[] = { 'F', 'o', 'o', 'b', 'a', 'r', '\0' };
    
    const char* s1 = R"foo(
    Hello
    World
    )foo";
    //same as
    const char* s2 = "\nHello\nWorld\n";
    
    int main()
    {
        std::cout << array1 << '\n';
        std::cout << array2 << '\n';
    
        std::cout << s1;
        std::cout << s2;
    }
    
     
  • Alan Ezust

    Alan Ezust - 2017-12-03
    • status: open --> closed-accepted
    • Group: none -->
     
  • Alan Ezust

    Alan Ezust - 2017-12-03

    Committed revision 24791.

     
  • Roman Tsourick

    Roman Tsourick - 2017-12-03

    it's done, as you already know, I suppose :)
    ...if you are talking about R literals.

     
  • Alan Ezust

    Alan Ezust - 2018-02-01

    I am getting exceptions on startup of jEdit suddenly related to this edit mode, if jEdit needs to open a cpp file to restore the previous open files of a project.
    Activity log attached.

     

    Last edit: Alan Ezust 2018-02-01
  • Alan Ezust

    Alan Ezust - 2018-02-01
    • status: closed-accepted --> pending-remind
     
  • Roman Tsourick

    Roman Tsourick - 2018-02-02

    I do not see any issues with my cpp test file. Could you also show me the file which triggers exceptions?

     
  • Roman Tsourick

    Roman Tsourick - 2018-02-02

    Well, my bad... I forgot to switch back from test modes to real. In the cplusplus.xml mode file all delegates to "c-14" must be replaced with just "c". I can make a commit.

     
  • Alan Ezust

    Alan Ezust - 2018-02-10
    • status: pending-remind --> closed-accepted
     
  • Alan Ezust

    Alan Ezust - 2018-02-10

    committed 24823

     

Log in to post a comment.