Closed Cxarli closed 9 years ago
@50Wliu I'm sorry, there was a misunderstanding with the NOT
, fixed here
Do any of the other keywords have not
? Would it be worth it to tokenize not
as something separate?
According to this site, NOT
is a keyword which can be used in a lot of places, so should I add it as a regular keyword?
Also, while I'm working on this file. W3Schools says that DECIMAL
, FLOAT
and a few other numbers with decimals exist. Should I use \\d+(\.\\d+)?
for number recognition ?
Yeah, adding not
as its own keyword would probably be a good idea (maybe keyword.other.not.sql
? /cc @MaximSokolov).
If you're going to change number recognition, please do that in a different PR.
It's bad that language-sql doesn't have specs yet. It's hard to see what this PR changes.
Could you give an example where not
is keyword.other.not.sql
now? Or add tests to this (see javascript-spec.coffee for example)
SELECT *
FROM suppliers
-- e.g. `NOT` here is still part of `keyword.other.data-integrity`. Should be?
WHERE supplier_name NOT IN ( 'IBM', 'Hewlett Packard', 'Microsoft' );
@MaximSokolov For example:
SELECT * FROM Users WHERE id IS NOT 3
and
SELECT * FROM Users WHERE id NOT REGEXP 'a**d'
Could you give an example where not is
keyword.other.not.sql
now?For example:
SELECT * FROM Users WHERE id IS NOT 3
SELECT * FROM Users WHERE id NOT REGEXP 'a**d'
Works well :+1:
@50Wliu:
adding not as its own keyword would probably be a good idea (maybe
keyword.other.not.sql
?
keyword.other.not
looks good to me. I suppose keyword.other.DML
means data manipulation language.
I am not quite sure that NOT
isn't part of DML
sub-scope.
Now that we're adding specs, it would be great if you could add some for this change as well :).
Looks like the specs work
:+1:
I thought
NOT
was a keyword on its own, but it isn't, so I addedNOT REGEXP
andNOT RLIKE
as keywords on their own