summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-02-05 08:49:37 +0100
committerGeorg Brandl <georg@python.org>2012-02-05 08:49:37 +0100
commitf9c7782595344ef9cdcb81f3ef93b6ca012d5f02 (patch)
tree80fed3f52579072ef0444508cc2b2c5170d45ed9
parent3dc520071eea10c4d2a27aca5308f4cba7a5f211 (diff)
downloadpygments-f9c7782595344ef9cdcb81f3ef93b6ca012d5f02.tar.gz
Closes #696: better analyse_text for objective-c lexer.
-rw-r--r--pygments/lexers/compiled.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index af153a54..023c02ef 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -1394,9 +1394,12 @@ class ObjectiveCLexer(RegexLexer):
}
def analyse_text(text):
- if '@"' in text: # strings
+ if '@import' in text or '@interface' in text or \
+ '@implementation' in text:
return True
- if re.match(r'\[[a-zA-Z0-9.]:', text): # message
+ elif '@"' in text: # strings
+ return True
+ elif re.match(r'\[[a-zA-Z0-9.]:', text): # message
return True
return False