From 9ac2244ba8363059f4187855e40839be288221a6 Mon Sep 17 00:00:00 2001 From: davidhcefx Date: Sun, 4 Feb 2024 02:19:47 +0800 Subject: [PATCH] feat(vlang): Add vlang highlighting Author : HARXI Version: 1.0.0 License: MIT --- v.nanorc | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 v.nanorc diff --git a/v.nanorc b/v.nanorc new file mode 100644 index 0000000..ea79970 --- /dev/null +++ b/v.nanorc @@ -0,0 +1,42 @@ +# The syntax highlight for V + +# Author : HARXI +# Version: 1.0.0 +# License: MIT + +syntax v "\.(v|c.v|.vsh|.vv)$" + +# Operators +color brightred "(\+|-|\*|/|%|~|&|(\|)|^|!|<|>|:=|=|\?|\.)" + +# Keywords +color bold,pink "\<(as|asm|assert|atomic|break|const|continue|defer|else|enum|false|fn|for|go|goto|if|import|in|interface|is|isreftype|lock|match|module|mut|none|or|pub|return|rlock|select|shared|sizeof|spawn|static|struct|true|type|typeof|union|unsafe|volatile|__global|__offsetof)\>" + +# Literals +color rosy "\<([0-9]+|0[oO][0-7]+|0[xX][[:xdigit:]]+)\>" +color rosy "\<[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?\>" +color rosy "\<[0-9]+[eE][+-]?[0-9]+\>" +color rosy "\<[0-9]+\>" + +# Types +color bold,pink "\<(bool|string|int|i(8|16|32|64|128)|u(8|16|32|64|128)|rune|f(32|64)|isize|usize|voidptr|any)\>" + +# Compile time +color brightblue "\$([a-zA-Z._0-9])+" + +# Flags +color brightblue "\#([a-zA-Z._0-9])+" + +# Upper case words +color rosy "[A-Z][A-Za-z0-9_]+" + +# Compile time constants +color pink "\@([a-zA-Z._0-9])+" + +# String and char +color brightyellow ""([^"\]|\\.)*"|'([^'\]|\\.)*'" +color brightgreen "`([^`\]|\\.)*`" + +# Comments +color brightblue start="/\*" end="\*/" +color brightblue "(^|[[:blank:]])//.*"