From b7fc1b03dba0c9d95328215aaa68b9d2cf83f944 Mon Sep 17 00:00:00 2001 From: jonigl Date: Thu, 16 Jul 2015 16:02:44 -0300 Subject: [PATCH] Works but... This needs to be aligned with the colors used for javascript --- php.nanorc | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 php.nanorc diff --git a/php.nanorc b/php.nanorc new file mode 100644 index 0000000..8021cac --- /dev/null +++ b/php.nanorc @@ -0,0 +1,40 @@ +## PHP Syntax Highlighting +syntax "php" "\.php[2345s~]?$" +color white start="<\?(php|=)?" end="\?>" +# Functions +color brightblue "([a-zA-Z0-9_-]*)\(" +# Constructs +color brightblue "(class|extends|goto) ([a-zA-Z0-9_]*)" +color green "[^a-z0-9_-]{1}(var|class|function|echo|case|break|default|exit|switch|if|else|elseif|endif|foreach|endforeach|@|while|public|private|protected|return|true|false|null|TRUE|FALSE|NULL|const|static|extends|as|array|require|include|require_once|include_once|define|do|continue|declare|goto|print|in)[^a-z0-9_-]{1}" +color brightblue "[a-zA-Z0-9]+:" +# Variables +color white "\$[a-zA-Z_0-9$]*|[=!<>]" +color white "\->[a-zA-Z_0-9$]*|[=!<>]" +# Special Characters +color yellow "[.,{}();]" +color yellow "\[" +color yellow "\]" +color yellow "[=][^>]" +# Numbers +color magenta "[+-]*([0-9]\.)*[0-9]+([eE][+-]?([0-9]\.)*[0-9])*" +color magenta "0x[0-9a-zA-Z]*" +# Special Variables +color brightblue "(\$this|parent::|self::|\$this-\>)" +# Bitwise Operations +color magenta "(\;|\||\^){1}" +# And/Or/SRO/etc +color green "(\;\;|\|\||::|=>|->)" +# Online Comments +color brightyellow "(#.*|//.*)$" +# STRINGS! +color red "('[^']*')|(\"[^\"]*\")" +# Inline Variables +color white "\{\$[^}]*\}" +# PHP Tags +color red "(<\?(php)?|\?>)" +# General HTML +color red start="\?>" end="<\?(php|=)?" +# trailing whitespace +color ,green "[^[:space:]]{1}[[:space:]]+$" +# multi-line comments +color brightyellow start="/\*" end="\*/"