Skip to content

Commit

Permalink
fix(php): Fix digits in variable not highlighted correctly
Browse files Browse the repository at this point in the history
- The number constant regex also seems broken
  • Loading branch information
davidhcefx committed Mar 7, 2024
1 parent d60cd21 commit aaa9d6c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions php.nanorc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ color brightblue "(class|extends|goto) ([a-zA-Z0-9_]*)"
color brightblue "\<(var|class|function|echo|case|break|default|exit|switch|if|else|elseif|endif|foreach|endforeach|@|while|public|private|protected|return|const|static|extends|as|array|require|include|require_once|include_once|define|do|continue|declare|goto|print|in|namespace|use)\>"
color brightblue "[a-zA-Z0-9_]+:"
# Variables
#color green "\$[a-zA-Z_0-9]*|[=!<>]"
#color green "\$[a-zA-Z_0-9$]*|[=!<>]"
#color green "\->[a-zA-Z_0-9$]*|[=!<>]"
color green "\$[a-zA-Z_0-9]*"
color green "\->[a-zA-Z_0-9]*"
Expand All @@ -24,7 +24,7 @@ color yellow "[.,{}();]"
color cyan "\["
color cyan "\]"
# Numbers
color magenta "[+-]*([0-9]\.)*[0-9]+([eE][+-]?([0-9]\.)*[0-9])*"
color magenta "\<[+-]?([0-9]*\.)?[0-9]+([eE][+-]?[0-9]+)?\>"
color magenta "0x[0-9a-zA-Z]*"
# Special Variables
color brightblue "(\$this|parent::|self::|\$this->)"
Expand All @@ -47,7 +47,7 @@ color red "\"([^"\]|\\.)*\""
# Single quoted string
color red "'([^'\]|\\.)*'"
# Heredoc (typically ends with a semicolon).
color red start="<<<['\"]?[A-Z][A-Z0-9_]*['\"]?" end="^[A-Z][A-Z0-9_]*;"
color red start="<<<[\"]?[A-Z][A-Z0-9_]*[\"]?" end="^[A-Z][A-Z0-9_]*;"
# Inline Variables
color white "\{\$[^}]*\}"
# Online Comments
Expand All @@ -60,3 +60,5 @@ color red start="\?>" end="<\?(php|=)?"
color ,green "[[:space:]]+$"
# multi-line comments
color brightyellow start="/\*" end="\*/"
# Nowdoc
color red start="<<<'[A-Z][A-Z0-9_]*'" end="^[A-Z][A-Z0-9_]*;"

0 comments on commit aaa9d6c

Please sign in to comment.