From 7755b9ebe7e75cadd0e4634eab5e6fdf626bf037 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 27 Jun 2017 21:19:40 -0400 Subject: [PATCH] added rudimentary ruby highlighting --- tide-hl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tide-hl b/tide-hl index 59f545e..3ec9d0c 100755 --- 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 #------------------------------------------------------------------------------- -- 2.49.0