summaryrefslogtreecommitdiff
path: root/pygments/lexers/compiled.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-06-18 13:49:00 +0200
committerGeorg Brandl <georg@python.org>2011-06-18 13:49:00 +0200
commit1507dac8fd099aad7afca378965ceb508b00dddd (patch)
tree7c7a3448b6b7628f8bd33e207c1b68854ad375ae /pygments/lexers/compiled.py
parent522b59a55921a278a847c573974811417cd9fac6 (diff)
parent0bf6072b0e75fa4b6afab5d23477d7aa4aa1c77c (diff)
downloadpygments-1507dac8fd099aad7afca378965ceb508b00dddd.tar.gz
merge with bgoetzmann/pygments-main
Diffstat (limited to 'pygments/lexers/compiled.py')
-rw-r--r--pygments/lexers/compiled.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 2945be98..6c9d7c87 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -35,7 +35,7 @@ class CLexer(RegexLexer):
"""
name = 'C'
aliases = ['c']
- filenames = ['*.c', '*.h']
+ filenames = ['*.c', '*.h', '*.idc']
mimetypes = ['text/x-chdr', 'text/x-csrc']
#: optional Comment or Whitespace
@@ -1136,7 +1136,7 @@ class ScalaLexer(RegexLexer):
(r'(true|false|null)\b', Keyword.Constant),
(r'(import|package)(\s+)', bygroups(Keyword, Text), 'import'),
(r'(type)(\s+)', bygroups(Keyword, Text), 'type'),
- (r'"""(?:.|\n)*?"""', String),
+ (r'""".*?"""', String),
(r'"(\\\\|\\"|[^"])*"', String),
(ur"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
# (ur'(\.)(%s|%s|`[^`]+`)' % (idrest, op), bygroups(Operator,
@@ -1144,7 +1144,7 @@ class ScalaLexer(RegexLexer):
(idrest, Name),
(r'`[^`]+`', Name),
(r'\[', Operator, 'typeparam'),
- (r'[\(\)\{\};,.]', Operator),
+ (r'[\(\)\{\};,.#]', Operator),
(op, Operator),
(ur'([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?',
Number.Float),
@@ -1309,6 +1309,13 @@ class ObjectiveCLexer(RegexLexer):
bygroups(using(this), Name.Function,
using(this), Text, Punctuation),
'function'),
+ # methods
+ (r'^([-+])(\s*)' # method marker
+ r'(\(.*?\))?(\s*)' # return type
+ r'([a-zA-Z$_][a-zA-Z0-9$_]*:?)', # begin of method name
+ bygroups(Keyword, Text, using(this),
+ Text, Name.Function),
+ 'method'),
# function declarations
(r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))' # return arguments
r'([a-zA-Z$_][a-zA-Z0-9$_]*)' # method name
@@ -1352,6 +1359,15 @@ class ObjectiveCLexer(RegexLexer):
('{', Punctuation, '#push'),
('}', Punctuation, '#pop'),
],
+ 'method': [
+ include('whitespace'),
+ (r'(\(.*?\))([a-zA-Z$_][a-zA-Z0-9$_]*)', bygroups(using(this),
+ Name.Variable)),
+ (r'[a-zA-Z$_][a-zA-Z0-9$_]*:', Name.Function),
+ (';', Punctuation, '#pop'),
+ ('{', Punctuation, 'function'),
+ ('', Text, '#pop'),
+ ],
'string': [
(r'"', String, '#pop'),
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),