Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++1y binary literals and digit separator #23

Open
msimonsson opened this issue May 19, 2014 · 2 comments
Open

C++1y binary literals and digit separator #23

msimonsson opened this issue May 19, 2014 · 2 comments

Comments

@msimonsson
Copy link

Clang 3.4 supports both:
http://clang.llvm.org/cxx_status.html#cxx14

#include <iostream>

int main()
{
    int n = 1'000'000;
    std::cout << n << std::endl;

    unsigned char c = 0b0100'0000;
    std::cout << c << std::endl;

    return 0;
}

I'm new to Vim syntax files, but the following seems to work for binary literals:

syn match   cNumber     display contained "0b[01]\+\(\'[01]\+\)*"
@rhysd
Copy link
Contributor

rhysd commented Feb 28, 2015

I added binary literal in #31. Please review it if you can. And as far as I tried, digit separater seems not to be broken in current highlighting.

@rhysd
Copy link
Contributor

rhysd commented Feb 28, 2015

I noticed that digit separater may break highlight.

int main()
{
    111'2'333;
    return 0;
}

Here, '2' is highlighted by Character and other parts are highlighted by Number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants