summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-03-30 00:26:15 +0000
committermurphy <murphy@rubychan.de>2010-03-30 00:26:15 +0000
commit6e01dd000e62f03f9a8e2658bf57b7730677c3f0 (patch)
tree452cae6dc3e049971842416a9859987636cbf897 /lib/coderay
parente844893db65abbcdbb6c67a249a22e246d9f13cc (diff)
downloadcoderay-6e01dd000e62f03f9a8e2658bf57b7730677c3f0.tar.gz
Added new keywords and functions to SQL scanner (see #221, thanks to Joshua Galvez).
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/scanners/sql.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/coderay/scanners/sql.rb b/lib/coderay/scanners/sql.rb
index 993afd5..3aeea77 100644
--- a/lib/coderay/scanners/sql.rb
+++ b/lib/coderay/scanners/sql.rb
@@ -11,7 +11,7 @@ module CodeRay module Scanners
for foreign from group if inner is join key
like not on or order outer primary references replace
then to trigger union using values when where
- left
+ left right distinct
)
OBJECTS = %w(
@@ -31,7 +31,7 @@ module CodeRay module Scanners
bool boolean hex bin oct
)
- PREDEFINED_FUNCTIONS = %w( sum cast substring abs pi count min max avg )
+ PREDEFINED_FUNCTIONS = %w( sum cast substring abs pi count min max avg now )
DIRECTIVES = %w( auto_increment unique default charset )
@@ -86,6 +86,7 @@ module CodeRay module Scanners
kind = :delimiter
elsif match = scan(/ @? [A-Za-z_][A-Za-z_0-9]* /x)
+ # FIXME: Don't match keywords after "."
kind = match[0] == ?@ ? :variable : IDENT_KIND[match.downcase]
elsif scan(/0[xX][0-9A-Fa-f]+/)