diff --git a/syntax/sql.nanorc b/syntax/sql.nanorc index ea7fcf68..f69f762c 100644 --- a/syntax/sql.nanorc +++ b/syntax/sql.nanorc @@ -1,11 +1,8 @@ ## Syntax highlighting for (Postgres) SQL scripts. -syntax sql "\.sql[2345s~]?$" +syntax sql "\.sql$" comment "-- " -# Functions. -color white "\<[a-z_]*\(" - # Types. color green "\<(int2|smallint|int4|int|integer|int8|bigint|decimal|numeric|real|double precision|(small|big)?serial)\>" color green "\<(bit( varying)?|boolean|bytea|enum|money|tsvector|uuid)\>" @@ -33,38 +30,17 @@ color blue "\<(PARSER|PREPARED?|PRIVILEGES|REASSIGN|REFRESH|RELEASE|RESET|REVOKE color blue "\<(SAVEPOINT|SCHEMA|SEARCH|SECURITY|SELECT|SEQUENCE|SERVER|SESSION|SET|SHOW|SPACE|START|SYSTEM)\>" color blue "\<(TABLE|TEXT|TO|TRANSACTION|TYPE|UPDATE|USER|VACUUM|VALUES|VIEW|WHERE|WITH|WRAPPER)\>" -# Strings. -color brightyellow "<[^= ]*>" ""(\.|[^"])*"" - # Trailing whitespace. color ,green "[[:space:]]+$" -# Regular expressions. -color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*" - -# Shell command expansion, between `backticks` or like %x{this}. -color brightblue "`[^`]*`" "%x\{[^}]*\}" - -# Strings, double-quoted. -color green ""([^"]|(\\"))*"" "%[QW]?(![^!]*!|\$[^$]*\$|\^[^^]*\^)" -color green "%[QW]?(\([^)]*\)|<[^>]*>|\[[^]]*\]|\{[^}]*\})" - -# Expression substitution for inside double-quoted strings, "like #{this}". -color brightgreen "#\{[^}]*\}" - -# Strings, single-quoted. -color green "'([^']|(\\'))*'" "%[qw](![^!]*!|\$[^$]*\$|\^[^^]*\^)" -color green "%[qw](\([^)]*\)|<[^>]*>|\[[^]]*\]|\{[^}]*\})" +# Strings, double-quoted and single-quoted. +color green ""([^"]|\\")*"|'([^']|\\')*'" # Comments. -color red "##?([^{].*|$)" -color red "--([^{].*|$)" +color red "--.*" color brightblue "//.*" color brightblue start="/\*" end="\*/" -# PostgreSQL markings. -color red "--" - # PostgreSQL default schemas. color brightred "\<(pg_catalog|public)\>"