summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
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),