From 9bf97f9ed8cca131284c214909c2730bdb3b96b1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 6 Jan 2011 19:01:05 +0000 Subject: Update syntax highlighting script. git-svn-id: http://svn.drobilla.net/resp/trunk@402 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- resp_highlight.py | 28 ++++++++++++++-------------- 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]): %s + print >>outfile, '''.highlight { margin: 0; padding: 1ex; border-width: 0; } ''' 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)) -- cgit v1.2.1