diff --git a/syntax/sql.nanorc b/syntax/sql.nanorc index d57c5ba4..6f6b0133 100644 --- a/syntax/sql.nanorc +++ b/syntax/sql.nanorc @@ -28,12 +28,16 @@ color brightyellow "\<(CASE|WHEN|IF|THEN|ELSE|ELSE?IF|LOOP|CONTINUE|EXIT)\>" color brightyellow "\<(FOR|FOREACH|IN|WHILE|END (CASE|IF|LOOP))\>" color magenta "\<(RAISE|EXCEPTION|NOTICE|RETURN)\>" +# Quoted identifiers. (First scare-color all, then uncolor what is valid.) +color ,red ""[^"]+"" +color normal ""[[:alpha:]_][[:alnum:]_$]*"" + +# Strings. +color green "'([^']|\\')*'" + # Trailing whitespace. color ,green "[[:space:]]+$" -# Strings, double-quoted and single-quoted. -color green ""([^"]|\\")*"|'([^']|\\')*'" - # Comments. color red "--.*" color brightblue "//.*"