Skip to content

(cpp) Inconsistent highlighting of top-level identifiers that start with a keyword #4394

Description

@pkaminski

Describe the issue
Identifiers at the top level that start with certain keywords (such as for, while, if, etc.) are not highlighted, while others get the hljs-built_in class. It's not clear to me which one is right but they should be treated the same.

Image

Which language seems to have the issue?
cpp

Are you using highlight or highlightAuto?
highlight

Sample Code to Reproduce
https://jsfiddle.net/2asbwfpq/

Expected behavior

testing();
format();
for_this();
std::forceSomething();
whilexyz();
if (ifsyz()) {}
returnxyz();
thisxyz();
putforce();
meanwhile();
mean_while();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions