From: Arthur Axel "fREW" Schmidt Date: Mon, 6 Sep 2010 16:04:29 +0000 (+0000) Subject: parse RNO, better coloring for some keywords X-Git-Tag: v1.70~89 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d0dd7dca3e4567a24fac14c18a267de0b53405d;p=dbsrgits%2FSQL-Abstract.git parse RNO, better coloring for some keywords --- diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index 24dbf6a..18cc184 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -45,6 +45,7 @@ my @expression_terminator_sql_keywords = ( 'INTERSECT', 'EXCEPT', 'RETURNING', + 'ROW_NUMBER \s* \( \s* \) \s+ OVER', ); # These are binary operator keywords always a single LHS and RHS @@ -84,6 +85,7 @@ my %indents = ( join => 1, on => 2, 'group by' => 1, + 'order by' => 1, ); my %profiles = ( @@ -124,9 +126,13 @@ my %profiles = ( eval { require Term::ANSIColor; $profiles{console}->{colormap} = { - select => [Term::ANSIColor::color('red'), Term::ANSIColor::color('reset')], - where => [Term::ANSIColor::color('green'), Term::ANSIColor::color('reset')], - from => [Term::ANSIColor::color('cyan'), Term::ANSIColor::color('reset')], + select => [Term::ANSIColor::color('red'), Term::ANSIColor::color('reset')], + where => [Term::ANSIColor::color('green'), Term::ANSIColor::color('reset')], + from => [Term::ANSIColor::color('cyan'), Term::ANSIColor::color('reset')], + join => [Term::ANSIColor::color('magenta'), Term::ANSIColor::color('reset')], + on => [Term::ANSIColor::color('blue'), Term::ANSIColor::color('reset')], + 'group by' => [Term::ANSIColor::color('cyan'), Term::ANSIColor::color('reset')], + 'order by' => [Term::ANSIColor::color('yellow'), Term::ANSIColor::color('reset')], }; };