summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/compiled.py15
-rw-r--r--tests/examplefiles/classes.dylan1
2 files changed, 15 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'),
diff --git a/tests/examplefiles/classes.dylan b/tests/examplefiles/classes.dylan
index 90cafdf6..7bb88faa 100644
--- a/tests/examplefiles/classes.dylan
+++ b/tests/examplefiles/classes.dylan
@@ -1,5 +1,6 @@
module: sample
comment: for make sure that does not highlight per word.
+ and it continues on to the next line.
define class <car> (<object>)
slot serial-number :: <integer> = unique-serial-number();