diff options
author | Bruce Mitchener, Jr. <bruce.mitchener@gmail.com> | 2013-01-09 17:39:58 +0700 |
---|---|---|
committer | Bruce Mitchener, Jr. <bruce.mitchener@gmail.com> | 2013-01-09 17:39:58 +0700 |
commit | 218d3996edd57c070cba936dfe45ae51cd014ebf (patch) | |
tree | c8e77f8c93bf05168f42155d418e8aeefd5fb7f8 /pygments | |
parent | f3e614b2a8ae54b7bf5a7ee7751c36fd952e6a30 (diff) | |
download | pygments-218d3996edd57c070cba936dfe45ae51cd014ebf.tar.gz |
[dylan] Correctly handle file headers.
Thanks to Georg Brandl for pointing me in the right direction.
Diffstat (limited to 'pygments')
-rw-r--r-- | pygments/lexers/compiled.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 385aca14..7dbc654e 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -1061,7 +1061,7 @@ class DylanLexer(RegexLexer): filenames = ['*.dylan', '*.dyl', '*.intr'] mimetypes = ['text/x-dylan'] - flags = re.DOTALL | re.IGNORECASE + flags = re.IGNORECASE builtins = set([ 'subclass', 'abstract', 'block', 'concrete', 'constant', 'class', @@ -1147,6 +1147,19 @@ class DylanLexer(RegexLexer): # single line comment (r'//.*?\n', Comment.Single), + # lid header + (r'([A-Za-z0-9-]+)(:)([ \t]*)(.*(?:\n[ \t].+)*)', + bygroups(Name.Attribute, Operator, Text, String)), + + ('', Text, 'code') # no header match, switch to code + ], + 'code': [ + # Whitespace + (r'\s+', Text), + + # single line comment + (r'//.*?\n', Comment.Single), + # multi-line comment (r'/\*', Comment.Multiline, 'comment'), |