summaryrefslogtreecommitdiff
path: root/pygments/lexers
diff options
context:
space:
mode:
authorblackbird <devnull@localhost>2006-11-14 09:19:55 +0100
committerblackbird <devnull@localhost>2006-11-14 09:19:55 +0100
commit6f41de95b70db73cacbb8257738f7a5fd497161c (patch)
tree87dd709e52d925e33296d6687a0d9d16a83842ed /pygments/lexers
parent3d4adee8d9eb6089fbe954608d2a3655139ca369 (diff)
downloadpygments-6f41de95b70db73cacbb8257738f7a5fd497161c.tar.gz
[svn] Fixed some bugs in the delphi lexer
Diffstat (limited to 'pygments/lexers')
-rw-r--r--pygments/lexers/compiled.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 9ffbebf1..6f11b3a5 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -199,22 +199,20 @@ class DelphiLexer(RegexLexer):
(r'(procedure|function)(\s+)', bygroups(Keyword, Text), 'funcname'),
(r'(abstract|and|array|as|assembler|at|begin|case|cdecl|'
r'class|const|constructor|contains|destructor|dispinterface|'
- r'div|do|downto|else|end|except|false|far|file|finalization|'
+ r'div|do|downto|else|end|except|far|file|finalization|'
r'finally|for|goto|if|implementation|in|inherited|'
r'initialization|inline|interface|is|label|mod|near|nil|not|'
r'object|of|on|or|overload|override|package|packed|pascal|'
r'private|program|property|protected|public|'
r'published|raise|record|register|repeat|requires|resourcestring|'
- r'safecall|self|set|shl|shr|stdcall|then|threadvar|to|true|try|'
+ r'safecall|self|set|shl|shr|stdcall|then|threadvar|to|try|'
r'type|unit|until|uses|var|varargs|virtual|while|with|xor|'
- r'break|assert|dec|inc)\b', Keyword),
+ r'break|assert)\b', Keyword),
(r'(AnsiString|Boolean|Byte|ByteBool|Cardinal|Char|Comp|'
r'Currency|Double|Extended|Int64|Integer|LongBool|LongInt|Real|'
r'Real48|ShortInt|ShortString|Single|SmallInt|String|WideChar|'
r'WideString|Word|WordBool)\b', Keyword.Type),
- (r'\{.*?\}', Comment),
- (r'\(\*.*?\*\)', Comment),
- (r'//.*?\n', Comment),
+ (r'(true|false|inc|dec)\b', Name.Builtin),
(r"'(''|[^']*)'", String),
(r'\$[0-9a-fA-F]+', Number),
(r'\#\$?[0-9]{1,3}', Number),
@@ -222,10 +220,18 @@ class DelphiLexer(RegexLexer):
(r'[@~!%^&*()+=|\[\]:;,.<>/?-]', Text),
(r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
(r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
+ include('comments')
+ ],
+ 'comments': [
+ (r'\{.*?\}', Comment),
+ (r'\(\*.*?\*\)', Comment),
+ (r'//.*?\n', Comment)
],
'uses': [
+ (r'(in)(\s+)(\'.*?\')', bygroups(Keyword, Text, String)),
(r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace),
- (r'\s*,\s*', Text),
+ (r'[\s,]', Text),
+ include('comments'),
(r';', Text, '#pop')
],
'funcname': [
@@ -234,9 +240,7 @@ class DelphiLexer(RegexLexer):
'asm': [
(r'end', Keyword, '#pop'),
(r'\s+', Text),
- (r'\{.*?\}', Comment),
- (r'\(\*.*?\*\)', Comment),
- (r'//.*?\n', Comment),
+ include('comments'),
(r'(AAA|AAD|AAM|AAS|ADC|ADD|AND|ARPL|BOUND|BSF|BSR|BSWAP|BT|'
r'BTC|BTR|BTS|CALL|CBW|CDQ|CLC|CLD|CLI|CLTS|CMC|CMP|CMPSB|'
r'CMPSD|CMPSW|CMPXCHG|CMPXCHG486|CMPXCHG8B|CPUID|CWD|CWDE|'