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

(CPP) The highlighter doesn't support variadic templates/parameter packs #2917

Closed
mortie opened this issue Dec 15, 2020 · 1 comment · Fixed by #2918
Closed

(CPP) The highlighter doesn't support variadic templates/parameter packs #2917

mortie opened this issue Dec 15, 2020 · 1 comment · Fixed by #2918
Labels
bug help welcome Could use help from community language

Comments

@mortie
Copy link
Contributor

mortie commented Dec 15, 2020

Describe the issue

This is valid C++ syntax:

template<typename... T>
void foo(const T &... args) {}

Yet, when highlighting with highlight, the returned object's illegalBy.msg is Illegal lexeme "." for mode "function".

Which language seems to have the issue?

cpp

Are you using highlight or highlightAuto?

highlight

Sample Code to Reproduce

Here's a modified version of the example JSFiddle: https://jsfiddle.net/dueh84nq/1/ - I changed it to display the illegal/illegalBy values.

Expected behavior

Since the syntax is legal, I would expect it to be highlighted somehow, not rejected as illegal.

Additional context

Here's some info on C++'s parameter packs: https://en.cppreference.com/w/cpp/language/parameter_pack

@mortie mortie added bug help welcome Could use help from community language labels Dec 15, 2020
@joshgoebel
Copy link
Member

joshgoebel commented Dec 15, 2020

// only allow /[\w\s\*&:<>]/
illegal: /[^\w\s\*&:<>]/,

Dropping . into this list of what is allowed (since it's negated) would likely resolved. Want to try making a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants