Commits

Anonymous committed e318e0d

[svn] Some improvements in the C/C++ lexers.

Comments (0)

Files changed (2)

pygments/formatters/bbcode.py

                 end = '[/u]' + end
             # there are no common BBcodes for background-color and border
 
-            self.styles[token] = start, end
+            self.styles[ttype] = start, end
 
     def format(self, tokensource, outfile):
         if self._code:

pygments/lexers/compiled.py

             (r'\n', Text),
             (r'\s+', Text),
             (r'\\\n', Text), # line continuation
-            (r'//.*?\n', Comment),
-            (r'/[*](.|\n)*?[*]/', Comment),
+            (r'//.*?(?!\\)\n', Comment),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment),
         ],
         'statements': [
             (r'L?"', String, 'string'),
             (r'\n', Text),
             (r'\s+', Text),
             (r'\\\n', Text), # line continuation
-            (r'//.*?\n', Comment),
-            (r'/[*](.|\n)*?[*]/', Comment),
+            (r'//.*?(?!\\)\n', Comment),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment),
             (r'[{}]', Keyword),
             (r'L?"', String, 'string'),
             (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),