package xm::code::sql;
use xm::o;
use xm::code::vars;
use xm::code::func;
"
highlight sourcecode - SQL mode
"}
$LANGUAGE{'sql'} = {
'filename' => '(?i)\\.sql$',
'regex' => '',
'patterns' => [
{
'name' => 'keywords I',
'regex' => '(?i)(,|%|<|>|:=|=|\\(|\\)|\\bselect|on|from|order by|desc|where|and|or|not|null|true|false)\\b',
'style' => 'reserved word',
'childregex' => []
},
{
'name' => 'comment I',
'regex' => '--.*?$',
'style' => 'comment',
'childregex' => []
},
{
'name' => 'comment II',
'regex' => '/\\*.*?\\*/',
'style' => 'comment',
'childregex' => []
},
{
'name' => 'string',
'regex' => '\'\'|\'.*?([^\\\\](\\\\\\\\)*)\'|\'\\\\\\\\\'',
'style' => 'string',
'childregex' => []
},
{
'name' => 'keywords II',
'regex' => '(?i)end if;|\\b(create|replace|begin|end|function|return|fetch|open|close|into|is|in|when|others|grant|on|to|exception|show|set|out|pragma|as|package)\\b',
'style' => 'reserved word',
'childregex' => []
},
{
'name' => 'keywords III',
'regex' => '(?i)\\balter\\b',
'style' => 'reserved word',
'childregex' => []
},
{
'name' => 'datatypes',
'regex' => '(?i)\\b(integer|blol|date|numeric|character|varying|varchar|char)\\b',
'style' => 'predefined type',
'childregex' => []
},
{
'name' => 'words',
'regex' => '(?i)\\b(constraint|key|references|primary|table|foreign|add|insert|group by)\\b',
'style' => 'reserved word',
'childregex' => []
}
]
};
return xm::code::func::DO($_[0],$LANGUAGE{c}{patterns});
}
return xm::o::args_stdin(@_, DESC); }
return DO(xm::o::args_stdin(@_, DESC)); }
1;