1. Georg Brandl
  2. pygments-main
Issue #688 resolved

C/C++ lexer bug

Bryan Jones
created an issue

Thanks for an amazing syntax highlighter! In using your library, I ran across a problem: the C/C++ lexer misclassifies a double forward slash comment followed by a preprocessor directive as all preprocessor. For example (see attached test.cpp):

{{{

!cpp

// comment

define blah 1

}}}

produces {{{

!html

<span class="cp">// comment</span> <span class="cp">#define blah 1</span> }}}

The comment should instead the the c1 class, not cp.

I'm using Pygments 1.4, Python 2.6.5, Windows Vista SP2

Comments (6)

  1. Log in to comment