symbol-processor/syntax-highlighting/def.nanorc

35 lines
794 B
Plaintext

syntax def "\.def$"
comment "//"
# Mistakes
# Missing semicolon
color red "[^;]$"
# Missing type
color red "^(((static|virtual)-)?method|property|static-property(-array)?) [a-zA-Z_][a-zA-Z0-9_]* ?(\(|=)"
# Missing prefix
color red "^[^ ]+"
# Missing vtable
color red "^(vtable(-size|-destructor-offset))? .+$"
# Reset
color normal "(\(|\))"
# Commands
color magenta "^(extends|size|vtable(-size|-destructor-offset)?|property|static-property|((static|virtual)-)?method|constructor)\>"
# Types
color green "\<((u?(char|short|int))|float|bool|void|std::(string|vector|map))\>"
# Numbers
color yellow "0x[a-f0-9]+"
# Non-hex numbers
color red " [0-9][a-f0-9]+;"
# Comments
color brightblue "//.*"
# Whitespace.
color normal "[[:space:]]+"
# Trailing whitespace.
color ,green "[[:space:]]+$"