Skip to content

psql.lang, file.sql: Add few missing ANSI and PostgreSQL keywords, fix number matching

In current number matching scheme there is a design flaw, as there are two rules: one for strict integers and other for real numbers. As you look at the second one, at this part of it: (\b[0-9]+(\.[0-9]+)?, it makes it clear, that it matches also strict integers. Currently the strict integer rule is matched first, so as a result integer part of a number is highlighted in one color, while the decimal part is highlighted in other color. As far as I am concerned, it looks odd (I've never seen this in any IDE).

So I placed real number matching rule before strict integer and now it looks consistent. However, because of current real number matching rule, integer matching rule will never get the chance to match anything. Presumably it could be rational to remove optional operator in decimal part matching rule, as the author, I suppose, had the intention to match integers and floats separately. But I guess this should be discussed.

Merge request reports