diff options
author | David Robillard <d@drobilla.net> | 2011-01-06 19:01:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-06 19:01:05 +0000 |
commit | 9bf97f9ed8cca131284c214909c2730bdb3b96b1 (patch) | |
tree | 5e79ed43beb7e2d3056ce774fe70f6ba9e4e10db | |
parent | 926830db4ca55dda653c780482c7710e617eb3a1 (diff) | |
download | resp-9bf97f9ed8cca131284c214909c2730bdb3b96b1.tar.gz resp-9bf97f9ed8cca131284c214909c2730bdb3b96b1.tar.bz2 resp-9bf97f9ed8cca131284c214909c2730bdb3b96b1.zip |
Update syntax highlighting script.
git-svn-id: http://svn.drobilla.net/resp/trunk@402 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rwxr-xr-x | resp_highlight.py | 28 | ||||
-rw-r--r-- | test/match.resp | 7 |
2 files changed, 18 insertions, 17 deletions
diff --git a/resp_highlight.py b/resp_highlight.py index 11ae298..a1432bb 100755 --- a/resp_highlight.py +++ b/resp_highlight.py @@ -19,8 +19,8 @@ class RespLexer(RegexLexer): filenames = ['*.resp'] mimetypes = ['text/x-resp', 'application/x-resp'] - keywords = [ 'fn', 'def', 'if', 'match', 'ns', 'type' ] - builtins = [ 'cons', 'car', 'cdr' ] + keywords = [ 'def', 'def-type', 'fn', 'if', 'let', 'match' ] + builtins = [ 'Tup' ] valid_name = r'[.a-zA-Z0-9!$%&*+,/:<=>?@^_~|-]+' @@ -74,12 +74,12 @@ class RespStyleDark(Style): default_style = "#FFF" background_color = "#222" styles = { - Comment: '#79E', - Keyword: '#EE5', + Comment: '#9BF', + Keyword: '#AFA', Name: '#DDD', Text: '#DDD', String: '#F88', - Keyword.Type: '#5E5', + Keyword.Type: '#BCE', Punctuation: '#AAA', Number: '#F88' } @@ -88,14 +88,14 @@ class RespStyleLight(Style): default_style = "#FFF" background_color = "#EEE" styles = { - Comment: '#57C', - Keyword: '#AA0', - Name: '#777', - Text: '#777', - String: '#D66', - Keyword.Type: '#3C3', - Punctuation: '#888', - Number: '#D66' + Comment: '#36A', + Keyword: '#181', + Name: '#000', + Text: '#000', + String: '#944', + Keyword.Type: '#236', + Punctuation: '#111', + Number: '#944' } if len(sys.argv) != 3: @@ -124,7 +124,7 @@ if re.match('.*\.html$', sys.argv[2]): <title>%s</title> <style type="text/css">''' % sys.argv[1] print >>outfile, formatter.get_style_defs('.highlight') - print >>outfile, ''' </style> + print >>outfile, '''.highlight { margin: 0; padding: 1ex; border-width: 0; }</style> </head> <body> ''' diff --git a/test/match.resp b/test/match.resp index 83ea505..0df0568 100644 --- a/test/match.resp +++ b/test/match.resp @@ -1,12 +1,13 @@ +; A Shape is either a Circle (w/ radius) or a Rectangle (w/ width/height) (def-type (Shape) (Circle Float) (Rectangle Float Float)) +; Return the area of s (def (area s) (match s - (Rectangle w h) (* w h) - (Circle r) (* 3.14159 r))) - + (Rectangle w h) (* w h) + (Circle r) (* 3.14159 r))) (def s (Rectangle 3.0 4.0)) |