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 function name differently highlighted in a declaration and definition #879

Closed
stefan-sf opened this issue Mar 4, 2018 · 0 comments
Closed

Comments

@stefan-sf
Copy link

Consider the following C code

void foo(void);
void foo(void) { }

which gets highlighted by rouge as follows

<span class="kt">void</span> <span class="n">foo</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
<span class="kt">void</span> <span class="nf">foo</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>

In the function declaration the name foo is highlighted as n while in the definition it is highlighted as fn. This behaviour is different than in pygments where the name of a function is also highlighted as fn in a declaration.

Is there a way to highlight the function name in the declaration also as fn?

vidarh added a commit to vidarh/rouge that referenced this issue Jan 18, 2019
…ghting

1. void foo(); without space before ";" does not highlight correctly.
2. else if() in certain contexts highlights incorrectly.
3. any error in a function definition or declaration has the potential
 to cause incorrect highlighting further down in the file.

Contains minor changes to Objc-C lexer to fix dependencies on the
C lexer that were broken by the C lexer fix.
pyrmont added a commit to pyrmont/rouge that referenced this issue May 12, 2019
…ghting (#37)

This fixes the following:

1. `void foo();` without space before `;` did not highlight correctly;
2. `else if()` in certain contexts highlights incorrectly; and
3. any error in a function definition or declaration has the potential
to cause incorrect highlighting further down in the file.

Contains minor changes to Obj-C lexer to fix dependencies on the
C lexer that were broken by the C lexer fix.
pyrmont pushed a commit to pyrmont/rouge that referenced this issue May 17, 2019
This commit fixes the following:

1. `void foo();` without space before `;` does not highlight correctly.
2. `else if()` in certain contexts highlights incorrectly.
3. any error in a function definition or declaration has the potential
   to cause incorrect highlighting further down in the file.

This also ontains minor changes to Objective-C lexer to fix dependencies
on the C lexer that were broken by the C lexer fix.

This fixes rouge-ruby#879 and rouge-ruby#1009.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant