summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-03-16 09:29:40 +0100
committerGeorg Brandl <georg@python.org>2014-03-16 09:29:40 +0100
commit5f970c05b90d16ceb70a7c11c33b5a6e14a02809 (patch)
treee5758268954d63a7217dd3e339dccc5a196a607a
parent7d7dc0f5fb180c0302f628ed4a12008868c04dc3 (diff)
parente9b859547feea53e1c4ad2fe9d3d694ddbee3eea (diff)
downloadpygments-5f970c05b90d16ceb70a7c11c33b5a6e14a02809.tar.gz
Merged in jaingaurav2/pygments-main/objc (pull request #299)
Detect Objective-C snippets if there is a NSNumber object
-rw-r--r--pygments/lexers/functional.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py
index ade26e97..55ac1937 100644
--- a/pygments/lexers/functional.py
+++ b/pygments/lexers/functional.py
@@ -996,7 +996,7 @@ class HaskellLexer(RegexLexer):
],
'character': [
# Allows multi-chars, incorrectly.
- (r"[^\\']", String.Char),
+ (r"[^\\']'", String.Char, '#pop'),
(r"\\", String.Escape, 'escape'),
("'", String.Char, '#pop'),
],
@@ -2532,7 +2532,7 @@ class NixLexer(RegexLexer):
('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in builtins),
Name.Builtin),
- (r'\b(true|false)\b', Name.Constant),
+ (r'\b(true|false|null)\b', Name.Constant),
# operators
('(%s)' % '|'.join(re.escape(entry) for entry in operators),
@@ -2559,7 +2559,8 @@ class NixLexer(RegexLexer):
(r'[a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9%/?:@&=+$,\\_.!~*\'-]+', Literal),
# names of variables
- (r'[a-zA-Z_][a-zA-Z0-9_\'-]*', String.Symbol),
+ (r'[a-zA-Z0-9-_]+\s*=', String.Symbol),
+ (r'[a-zA-Z_][a-zA-Z0-9_\'-]*', Text),
],
'comment': [