diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2011-11-20 22:58:41 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2011-11-20 22:58:41 +0700 |
commit | 254267afdd6a9609ec62948a3ef23084f338dfbc (patch) | |
tree | f9db96bdbbc284fb81b5dde307d9b25b7a51f206 | |
parent | 67fa170644fa09017933f2c7b12a9dbe1fdd74fb (diff) | |
download | pygments-254267afdd6a9609ec62948a3ef23084f338dfbc.tar.gz |
Fixes to the DylanLexer plus illustrative examples that previously failed.
-rw-r--r-- | pygments/lexers/compiled.py | 4 | ||||
-rw-r--r-- | tests/examplefiles/classes.dylan | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index 5da2b875..0e14c74b 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -1232,8 +1232,10 @@ class DylanLexer(RegexLexer): (r'\$[a-zA-Z0-9-]+', Name.Constant), (r'[!$%&*/:<>=?~^.+\[\]{}-]+', Operator), (r'\s+', Text), + (r'#"[a-zA-Z0-9-]+"', Keyword), (r'#[a-zA-Z0-9-]+', Keyword), - (r'[a-zA-Z0-9-]+', Name.Variable), + (r'#(\(|\[)', Punctuation), + (r'[a-zA-Z0-9-_]+', Name.Variable), ], 'string': [ (r'"', String, '#pop'), diff --git a/tests/examplefiles/classes.dylan b/tests/examplefiles/classes.dylan index ff435b77..6dd55ff2 100644 --- a/tests/examplefiles/classes.dylan +++ b/tests/examplefiles/classes.dylan @@ -22,3 +22,19 @@ end function; define constant $blue-car = make(<car>, model: "Viper"); define constant $black-car = make(<car>, model: "Town Car", sunroof?: #t); define constant $red-car = make(<car>, model: "F40", sunroof?: #f); + +define method foo() => _ :: <boolean> + #t +end method; + +define method foo() => _ :: <boolean>; + #t +end method; + +define method \+() +end; + +define constant $symbol = #"hello"; +define variable *vector* = #[3.5, 5] +define constant $list = #(1, 2); +define constant $pair = #(1 . "foo") |