From 390e14b023e7f8bd1a9e11a17cec36d90ba774a0 Mon Sep 17 00:00:00 2001 From: Aryan Ebrahimpour Date: Fri, 21 Jun 2019 13:56:09 +0430 Subject: [PATCH 1/2] Add fsharp --- fsharp.nanorc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 fsharp.nanorc diff --git a/fsharp.nanorc b/fsharp.nanorc new file mode 100644 index 0000000..c5d8cc4 --- /dev/null +++ b/fsharp.nanorc @@ -0,0 +1,33 @@ +syntax "F#" "\.fs$" "\.fsx$" + +# Type and Module Definitions +color brightgreen "type +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" +color brightgreen "module +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" +color brightmagenta "\<(List|Seq|Array|list|seq|array|ref|in|out)\>" +color brightmagenta "[<+[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?>]" # Attributes + +# Annotation +color magenta "@[A-Za-z]+" + +# Basic Types +color brightgreen "\<(bool|byte|sbyte|int16|uint16|int|uint32|int64|uint64|char|decimal|double|float|float32|single|nativeint|IntPtr|unativeint|UIntPtr|object|string)\>" + +# Keywords +color cyan "\<(abstract|and|let|as|assert|base|begin|class|default|delegate|do|for|to|in|while|done|downcast|downto|elif|if|then|else|end|exception|extern|false|finally|try|fixed|fun|function|match|global|inherit|inline|interface|internal|lazy|let!|match!|member|module|mutable|namespace|new|not|not struct|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|true|with|type|upcast|use|use!|val|void|when|yield|yield!)\>" + +color red "[-+/*=<>?:!~%&|]" +color blue "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>" +color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'" +color magenta "\\([btnfr]|'|\"|\\)" +color magenta "\\u[A-Fa-f0-9]{4}" + +# Comments +color brightblack "(^|[[:space:]])//.*" +color brightblack start="/\*" end="\*/" +color brightblack start="\(\*" end="\*\)" +color brightwhite,cyan "TODO:?" + +color ,green "[[:space:]]+$" +color ,red " + +| + +" + +color white start="``" end="``" \ No newline at end of file From 221f368c2c7c1c5b798159b1b54f828ad3a6885f Mon Sep 17 00:00:00 2001 From: Aryan Ebrahimpour Date: Fri, 21 Jun 2019 14:17:13 +0430 Subject: [PATCH 2/2] update rules --- fsharp.nanorc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fsharp.nanorc b/fsharp.nanorc index c5d8cc4..7be77cc 100644 --- a/fsharp.nanorc +++ b/fsharp.nanorc @@ -3,21 +3,22 @@ syntax "F#" "\.fs$" "\.fsx$" # Type and Module Definitions color brightgreen "type +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" color brightgreen "module +[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?" -color brightmagenta "\<(List|Seq|Array|list|seq|array|ref|in|out)\>" +color brightmagenta "\<(List|Seq|Array|Option|Choice|Map|list|seq|array|option|choice|ref|in|out)\>" +color brightgreen "<+[A-Za-z0-9'^]+ *((:) +[A-Za-z0-9'^.]+)?>" color brightmagenta "[<+[A-Za-z0-9]+ *((:) +[A-Za-z0-9.]+)?>]" # Attributes # Annotation color magenta "@[A-Za-z]+" # Basic Types -color brightgreen "\<(bool|byte|sbyte|int16|uint16|int|uint32|int64|uint64|char|decimal|double|float|float32|single|nativeint|IntPtr|unativeint|UIntPtr|object|string)\>" +color brightgreen "\<(bool|byte|sbyte|int16|uint16|int|uint32|int64|uint64|char|decimal|double|float|float32|single|nativeint|IntPtr|unativeint|UIntPtr|object|string)\>" # Keywords -color cyan "\<(abstract|and|let|as|assert|base|begin|class|default|delegate|do|for|to|in|while|done|downcast|downto|elif|if|then|else|end|exception|extern|false|finally|try|fixed|fun|function|match|global|inherit|inline|interface|internal|lazy|let!|match!|member|module|mutable|namespace|new|not|not struct|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|true|with|type|upcast|use|use!|val|void|when|yield|yield!)\>" +color cyan "\<(abstract|and|let|as|assert|base|begin|class|default|delegate|do|for|to|in|while|done|downcast|downto|elif|if|then|else|end|exception|extern|false|finally|try|fixed|fun|function|match|global|inherit|inline|interface|internal|lazy|let!|match!|member|module|mutable|namespace|new|not|not struct|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|true|with|type|upcast|use|use!|val|void|when|yield|yield!)\>" color red "[-+/*=<>?:!~%&|]" color blue "\<([0-9._]+|0x[A-Fa-f0-9_]+|0b[0-1_]+)[FL]?\>" -color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'" +color yellow ""(\\.|[^"])*"" # String color magenta "\\([btnfr]|'|\"|\\)" color magenta "\\u[A-Fa-f0-9]{4}" @@ -30,4 +31,7 @@ color brightwhite,cyan "TODO:?" color ,green "[[:space:]]+$" color ,red " + +| + +" +color red "#if .+" +color red "#endif" + color white start="``" end="``" \ No newline at end of file