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

C++ lexer doesn't recognize the first function name #1967

Open
egor-tensin opened this issue Jun 7, 2023 · 0 comments
Open

C++ lexer doesn't recognize the first function name #1967

egor-tensin opened this issue Jun 7, 2023 · 0 comments
Labels
bugfix-request A request for a bugfix to be developed.

Comments

@egor-tensin
Copy link

Name of the lexer
cpp

Code sample

namespace {

void f1() {
}

void f2() {
}

void f3() {
}

}

rouge.jneen.net doesn't seem to work.

# bundle exec rougify version
4.1.2

The first function f1 doesn't get recognized as a function name here (f2 and f3 do).

# bundle exec rougify highlight -i test1.cpp --formatter-preset html
<span class="k">namespace</span> <span class="p">{</span>

<span class="kt">void</span> <span class="n">f1</span><span class="p">()</span> <span class="p">{</span>
<span class="p">}</span>

<span class="kt">void</span> <span class="nf">f2</span><span class="p">()</span> <span class="p">{</span>
<span class="p">}</span>

<span class="kt">void</span> <span class="nf">f3</span><span class="p">()</span> <span class="p">{</span>
<span class="p">}</span>

<span class="p">}</span>

Notice how f1 has the span class of n, while f2 & f3 have the correct class nf.

@egor-tensin egor-tensin added the bugfix-request A request for a bugfix to be developed. label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

No branches or pull requests

1 participant