Skip to content

Commit aaa9d6c

Browse files
committed
fix(php): Fix digits in variable not highlighted correctly
- The number constant regex also seems broken
1 parent d60cd21 commit aaa9d6c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

php.nanorc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ color brightblue "(class|extends|goto) ([a-zA-Z0-9_]*)"
1111
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)\>"
1212
color brightblue "[a-zA-Z0-9_]+:"
1313
# Variables
14-
#color green "\$[a-zA-Z_0-9]*|[=!<>]"
14+
#color green "\$[a-zA-Z_0-9$]*|[=!<>]"
1515
#color green "\->[a-zA-Z_0-9$]*|[=!<>]"
1616
color green "\$[a-zA-Z_0-9]*"
1717
color green "\->[a-zA-Z_0-9]*"
@@ -24,7 +24,7 @@ color yellow "[.,{}();]"
2424
color cyan "\["
2525
color cyan "\]"
2626
# Numbers
27-
color magenta "[+-]*([0-9]\.)*[0-9]+([eE][+-]?([0-9]\.)*[0-9])*"
27+
color magenta "\<[+-]?([0-9]*\.)?[0-9]+([eE][+-]?[0-9]+)?\>"
2828
color magenta "0x[0-9a-zA-Z]*"
2929
# Special Variables
3030
color brightblue "(\$this|parent::|self::|\$this->)"
@@ -47,7 +47,7 @@ color red "\"([^"\]|\\.)*\""
4747
# Single quoted string
4848
color red "'([^'\]|\\.)*'"
4949
# Heredoc (typically ends with a semicolon).
50-
color red start="<<<['\"]?[A-Z][A-Z0-9_]*['\"]?" end="^[A-Z][A-Z0-9_]*;"
50+
color red start="<<<[\"]?[A-Z][A-Z0-9_]*[\"]?" end="^[A-Z][A-Z0-9_]*;"
5151
# Inline Variables
5252
color white "\{\$[^}]*\}"
5353
# Online Comments
@@ -60,3 +60,5 @@ color red start="\?>" end="<\?(php|=)?"
6060
color ,green "[[:space:]]+$"
6161
# multi-line comments
6262
color brightyellow start="/\*" end="\*/"
63+
# Nowdoc
64+
color red start="<<<'[A-Z][A-Z0-9_]*'" end="^[A-Z][A-Z0-9_]*;"

0 commit comments

Comments
 (0)