Prism C++ incorrectly colors overloaded operator< and operator> in sequence
Open
Nobody has claimed this yet.
bug
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Repro steps:
- Go to https://prismjs.com/test.html#language=cpp
- Paste in this code:
bool operator< (const Foo& f1, const Foo& f2)
{
return f1.foo < f2.foo;
}
bool operator> (const Foo& f1, const Foo& f2)
{
return f1.foo > f2.foo;
}
Note that foo < f2.foo from the top function and the > in operator> in the bottom function are the wrong color.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the C++ example in prismjs.com/test.html and reproduce the highlighting with the two overloaded operators shown in the issue. Trace the Prism C++ grammar entry point responsible for these tokens, then verify that both comparison expressions and operator< and operator> receive the intended colors in the test page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100