I defined sqlVariable and sqlString in my syntax file as
syn match sqlVariable ":[az][a-z0-9_#$]*" syn region sqlString start=+'+ end=+'+ contains=sqlVariable
(plus some other quote options.) Strings can contain sqlVariable to highlight bindings in dynamic code, for example :b1 in 'select a from b where c = :b1' . (This is for Oracle, by the way.)
All this works great - except in the particular annoying case of date format masks containing a colon, for example
to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')
: MI and: SS stand out as variables, because, of course, they match my pattern.
Is there a way to do: MI and: SS does not match sqlVariable in the quoted string? (I think that only these two things will do it.)
source share