Skip to content

C/C++ issue on float suffix highlighting #577

@vser1

Description

@vser1

Following cppreference.com, the suffixes for floats are f, F, l, L while in the following example, rouge 2.0.7 (tested on gitlab 8.14) highlights the suffixes l, L, u, U.

 	float test(8.874L);
 	float test(8.874l);
 	float test(8.874F);
 	float test(8.874f);
 	float test(8.874U);
 	float test(8.874u);

AFAICT this is a bug, isn't? From my analyses of the regexp, there might be other issues, notably with binary literals (C++14) — edit confirmed, or hexadecimal floats (C++17) — for some reason it's recognized.

I have another question: on my example, the dots aren't colorized, is this on purpose (the types not supporting colorized dots) or because the first number (the 8 before the dot) is recognized as an int literal and the second half too but not the dot in between?

snippet on gitlab 8.14 (rouge 2.0.7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfix-requestA request for a bugfix to be developed.pr-openA PR addressing this issue is open.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions