1
0
mirror of https://github.com/scopatz/nanorc synced 2024-10-31 23:00:00 +01:00
nanorc/Rnw.nanorc
davidhcefx b5b285fbf9 Force all syntax regex to ends with $
- Lots of syntax regex are poorly written and did not ends with a '$',
   which caused them competing with other regex rules.
2023-04-12 15:13:33 +08:00

40 lines
1.3 KiB
Plaintext

## Here is a short example for TeX files.
##
syntax "Tex" "\.Rnw$" "bib$" "\.bib$" "cls$" "\.cls$"
color yellow "\$(\\\$|[^$])*[^\\]\$"
color yellow "\$\$(\\\$|[^$])*[^\\]\$\$"
icolor green "\\.|\\[A-Z]*"
color magenta "[{}]"
color red start="<<" end=">>="
color white start=">>=" end="@"
color brightblue "%.*"
color brightblue "^[[:space:]]*#.*"
color brightblue start="\\begin\{comment\}" end="\\end\{comment\}"
color green "(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|namespace|use)[^a-z0-9_-]{1}"
# Functions
color blue "([a-zA-Z0-9_\-$\.]*)\("
# Variables
color magenta "[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 blue "(\$this|parent::|self::|\$this->)"
# Bitwise Operations
color magenta "(\;|\||\^){1}"
# And/Or/SRO/etc
color green "(\;\;|\|\||::|=>|->)"
# STRINGS!
color red "('[^']*')|(\"[^\"]*\")"