summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2006-10-30 22:15:14 +0100
committergbrandl <devnull@localhost>2006-10-30 22:15:14 +0100
commit985cab8b605c98d362bfaf3ec67f14fafb2b3c61 (patch)
tree3a35086220aa113a0e96afdceefa2d021abbb7ec /pygments
parentbb599185f7a0d8c865879e3b62b92f3faf2c074c (diff)
downloadpygments-985cab8b605c98d362bfaf3ec67f14fafb2b3c61.tar.gz
[svn] Some improvements in the C/C++ lexers.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/formatters/bbcode.py2
-rw-r--r--pygments/lexers/compiled.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/pygments/formatters/bbcode.py b/pygments/formatters/bbcode.py
index a03afdb1..228c0a4d 100644
--- a/pygments/formatters/bbcode.py
+++ b/pygments/formatters/bbcode.py
@@ -64,7 +64,7 @@ class BBCodeFormatter(Formatter):
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:
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 81da1f04..003c7fff 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -35,8 +35,8 @@ class CLexer(RegexLexer):
(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'),
@@ -126,8 +126,8 @@ class CppLexer(RegexLexer):
(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),