highlightjs / highlightjs/highlight.js

(cpp) Keywords followed by parens are treated as `built_in`

Open
#3,980 13 comments 0 reactions 0 assignees View on GitHub
bug good first issue help welcome language
Dominant language
JavaScript
Stars
25k
Forks
3.8k
Avg merge
11h 35m
Merged PRs (30d)
3

Description

**Describe the issue**
Keywords, such as `static_assert`, `sizeof`, etc. are typically followed by parentheses. `static_assert;` will be highlighted as if it's a keyword, but `static_assert(true);` is highlighted as a built_in.

![image](https://github.com/highlightjs/highlight.js/assets/8622748/045d91a2-fee7-4799-955c-488dceea47e5)

**Which language seems to have the issue?**
```


```

**Are you using `highlight` or `highlightAuto`?**

`highlight`, I think?

**Sample Code to Reproduce**

In reveal.js, with a freshly-downloaded hljs, add the following:

```



static_assert; // highlighted as keyword
static_assert(true); // highlighted as built_in

```

**Expected behavior**

Keywords continue to use their keyword colour when followed by parens.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.