summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2006-10-30 10:21:18 +0100
committergbrandl <devnull@localhost>2006-10-30 10:21:18 +0100
commita8fdbfc1e96a22fad673e6170822518a292eaf98 (patch)
tree5ae25bb83f1b062f7096a30f32a81ff8a0f887f7 /pygments
parent1c4e080bb82d27c914a763ae9ef0667dcc6031c1 (diff)
downloadpygments-a8fdbfc1e96a22fad673e6170822518a292eaf98.tar.gz
[svn] Implement goto label support for C, C++, Delphi.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/compiled.py6
-rw-r--r--pygments/lexers/special.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index aa08de90..81da1f04 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -57,6 +57,7 @@ class CLexer(RegexLexer):
(r'__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|'
r'declspec|finally|int64|try|leave)\b', Keyword.Reserved),
(r'(true|false|NULL)\b', Keyword.Constant),
+ ('[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
('[a-zA-Z_][a-zA-Z0-9_]*', Name),
],
'root': [
@@ -154,6 +155,7 @@ class CppLexer(RegexLexer):
r'multiple_inheritance|m128i|m128d|m128|m64|interface|'
r'identifier|forceinline|event|assume)\b', Keyword.Reserved),
(r'(true|false|NULL)\b', Keyword.Constant),
+ ('[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
('[a-zA-Z_][a-zA-Z0-9_]*', Name),
],
'classname': [
@@ -218,7 +220,8 @@ class DelphiLexer(RegexLexer):
(r'\#\$?[0-9]{1,3}', Number),
(r'[0-9]', Number),
(r'[@~!%^&*()+=|\[\]:;,.<>/?-]', Text),
- (r'[a-zA-Z_][a-zA-Z0-9_]*', Name)
+ (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
+ (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
],
'uses': [
(r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace),
@@ -305,6 +308,7 @@ class JavaLexer(RegexLexer):
(r'(class)(\s+)', bygroups(Keyword, Text), 'class'),
(r'"(\\\\|\\"|[^"])*"', String),
(r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
+ (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
(r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
(r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number),
diff --git a/pygments/lexers/special.py b/pygments/lexers/special.py
index dcf9899c..34e8d88e 100644
--- a/pygments/lexers/special.py
+++ b/pygments/lexers/special.py
@@ -70,7 +70,7 @@ class RawTokenLexer(Lexer):
ttypestr, val = match.group().split('\t', 1)
except ValueError:
val = match.group()
- ttype = Error
+ ttype = Error
else:
ttype = _ttype_cache.get(ttypestr)
if not ttype: