C++ lexer doesn't recognize function if return type is templated

Open
#1,138 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, python
Domain
tooling

Research direction

No file or test is named in the issue. Start at Pygments' C++ lexer, reproduce both snippets, and find the existing function-name highlighting coverage. Done means the templated-return example highlights func while the non-templated example continues to do so.

Written by the indexing model from the issue text.

Description

A-lexing good first issue help wanted

(Original issue 1434 created by kaka345 on 2018-03-31T17:49:31.980596+00:00)

For this snippet the function name isn't highlighted because its return type is a template:

#!c++
std::vector<int> func()
{
  std::vector<int> v = {0};
  return v;
}

For this snippet the function name is highlighted because its return type is not a template:

#!c++
int func()
{
  return 0;
}
Dominant language
Python
Stars
2.2k
Forks
885
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pygments/pygments

All issues in pygments/pygments

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.