]> git.mdlowis.com Git - projs/tide.git/commitdiff
added rudimentary ruby highlighting
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 28 Jun 2017 01:19:40 +0000 (21:19 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 28 Jun 2017 01:19:40 +0000 (21:19 -0400)
tide-hl

diff --git a/tide-hl b/tide-hl
index 59f545e39e1bbee7b3fc656583c8fb9819b99d82..3ec9d0cd5452d76f089a7c9e0b14bd52b679a389 100755 (executable)
--- a/tide-hl
+++ b/tide-hl
@@ -135,7 +135,20 @@ language "C" do
 end
 
 language "Ruby" do
+  keywords = Set.new %w[
+    if not then else elsif end def do exit nil
+    goto break return continue case default switch while for
+  ]
+
+  range start=/%[qQrilwWs]\[/, stop=/\]/, :String
   match /#.*$/, :Comment
+  match /"(\\"|[^"\n])*"/, :String
+  match /'(\\'|[^'\n])*'/, :String
+  match /\/(\\\/|[^\/\n])*\//, :String
+  match /[A-Z][0-9a-zA-Z_]*/, :Type
+  match_sets /[a-z_][0-9a-zA-Z_]*/, :Keyword => keywords
+  match /0x[0-9a-fA-F]+/, :Number
+  match /[0-9]+/, :Number
 end
 
 #-------------------------------------------------------------------------------