diff --git a/syntax/php.nanorc b/syntax/php.nanorc index 141e44e6..a69c85a1 100644 --- a/syntax/php.nanorc +++ b/syntax/php.nanorc @@ -7,26 +7,29 @@ comment "//" # PHP markings. color brightgreen "(<\?(php)?|\?>)" -# Functions. +# Function names. color white "\<[a-z_]*\(" +# Variable names. +color cyan "\$[a-z_]+" # Types. -color green "\<(bool|char|const|double|enum|float|global|int|var)\>" +color green "\<(array|bool|callable|const|float|global|int|object|static|string|var)\>" -# Structure. -color brightyellow "\<(class|function|new|private|protected|public|for|foreach|while|do|if|else|elseif|switch|case|default)\>" +# Directives and structure. +color brightyellow "\<(abstract|as|class|clone|declare|enddeclare|extends|function|implements|include(_once)?|inst(ance|ead)of|interface|namespace|new|private|protected|public|require(_once)?|trait|use|yield)\>" +color brightyellow "\<(case|catch|default|do|echo|else(if)?|end(for(each)?|if|switch|while)|final(ly)?|for(each)?|if|print|switch|throw|try|while)\>" +# Operators. +color brightyellow "\<(and|or|xor)\>" # Control flow. color magenta "\<(break|continue|goto|return)\>" # Strings. -color brightyellow "<[^= ]*>" ""(\.|[^"])*"" +color brightyellow ""(\.|[^"])*"" "'(\.|[^'])*'" # Comments. -color brightblue "//.*" +color brightblue "(^|[[:space:]]+)//.*" color brightblue start="/\*" end="\*/" -##color blue start="<" end=">" -##color red "&[^;[:space:]]*;" # Trailing whitespace. color ,green "[[:space:]]+$"