annotate runtime/syntax/unison.vim @ 34079:231c0e600dd6

Added tag v9.1.0008 for changeset 56a4023b605df0f0b9b80006a492a4764ed075b7
author Christian Brabandt <cb@256bit.org>
date Thu, 04 Jan 2024 22:30:03 +0100
parents 2200e4e8b3ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32702
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim syntax file
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 "
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Language: unison
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 " Maintainer: Anton Parkhomenko <anton@chuwy.me>
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 " Last Change: Aug 7, 2023
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 " Original Author: John Williams, Paul Chiusano and Rúnar Bjarnason
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 if exists("b:current_syntax")
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 finish
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 endif
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 syntax include @markdown $VIMRUNTIME/syntax/markdown.vim
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 syn cluster markdownLikeDocs contains=markdownBold,markdownItalic,markdownLinkText,markdownListMarker,markdownOrderedListMarker,markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 syn match unisonOperator "[-!#$%&\*\+/<=>\?@\\^|~]"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 syn match unisonDelimiter "[\[\](){},.]"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 " Strings and constants
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 syn match unisonSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 syn match unisonSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 syn match unisonSpecialCharError contained "\\&\|'''\+"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 syn region unisonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=unisonSpecialChar
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 syn match unisonCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=unisonSpecialChar,unisonSpecialCharError
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 syn match unisonCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=unisonSpecialChar,unisonSpecialCharError
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 syn match unisonNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 syn match unisonFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 " Keyword definitions. These must be patterns instead of keywords
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 " because otherwise they would match as keywords at the start of a
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 " "literate" comment (see lu.vim).
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 syn match unisonModule "\<namespace\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 syn match unisonImport "\<use\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 syn match unisonTypedef "\<\(unique\|structural\|∀\|forall\)\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 syn match unisonStatement "\<\(ability\|do\|type\|where\|match\|cases\|;\|let\|with\|handle\)\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 syn match unisonConditional "\<\(if\|else\|then\)\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 syn match unisonBoolean "\<\(true\|false\)\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 syn match unisonType "\<\C[A-Z][0-9A-Za-z_'!]*\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 syn match unisonName "\<\C[a-z_][0-9A-Za-z_'!]*\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 " Comments
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 syn match unisonLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 syn region unisonBlockComment start="{-" end="-}" contains=unisonBlockComment
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46 syn region unisonBelowFold start="^---" skip="." end="." contains=unisonBelowFold
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 " Docs
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 syn region unisonDocBlock matchgroup=unisonDoc start="{{" end="}}" contains=unisonDocTypecheck,unisonDocQuasiquote,unisonDocDirective,unisonDocCode,unisonDocCodeInline,unisonDocCodeRaw,unisonDocMono,@markdownLikeDocs
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 syn region unisonDocQuasiquote contained matchgroup=unisonDocQuote start="{{" end= "}}" contains=TOP
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 syn region unisonDocCode contained matchgroup=unisonDocCode start="^\s*```\s*$" end="^\s*```\s*$" contains=TOP
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 syn region unisonDocTypecheck contained matchgroup=unisonDocCode start="^\s*@typecheck\s*```\s*$" end="^\s*```\s*$" contains=TOP
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 syn region unisonDocCodeRaw contained matchgroup=unisonDocCode start="^\s*```\s*raw\s*$" end="^\s*```\s*$" contains=NoSyntax
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 syn region unisonDocCodeInline contained matchgroup=unisonDocCode start="`\@<!``" end="`\@<!``" contains=TOP
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 syn match unisonDocMono "''[^']*''"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
56 syn region unisonDocDirective contained matchgroup=unisonDocDirective start="\(@\([a-zA-Z0-9_']*\)\)\?{{\@!" end="}" contains=TOP
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
58 syn match unisonDebug "\<\(todo\|bug\|Debug.trace\|Debug.evalToText\)\>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60 " things like
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 " > my_func 1 3
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62 " test> Function.tap.tests.t1 = check let
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 " use Nat == +
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 " ( 99, 100 ) === (withInitialValue 0 do
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 " : : :
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 syn match unisonWatch "^[A-Za-z]*>"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 hi def link unisonWatch Debug
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69 hi def link unisonDocMono Delimiter
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 hi def link unisonDocDirective Import
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 hi def link unisonDocQuote Delimiter
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 hi def link unisonDocCode Delimiter
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73 hi def link unisonDoc String
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 hi def link unisonBelowFold Comment
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 hi def link unisonBlockComment Comment
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76 hi def link unisonBoolean Boolean
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
77 hi def link unisonCharacter Character
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 hi def link unisonComment Comment
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79 hi def link unisonConditional Conditional
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 hi def link unisonConditional Conditional
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 hi def link unisonDebug Debug
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82 hi def link unisonDelimiter Delimiter
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
83 hi def link unisonDocBlock String
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 hi def link unisonDocDirective Import
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85 hi def link unisonDocIncluded Import
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
86 hi def link unisonFloat Float
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87 hi def link unisonImport Include
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 hi def link unisonLineComment Comment
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
89 hi def link unisonLink Type
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 hi def link unisonName Identifier
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 hi def link unisonNumber Number
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 hi def link unisonOperator Operator
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
93 hi def link unisonSpecialChar SpecialChar
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 hi def link unisonSpecialCharError Error
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95 hi def link unisonStatement Statement
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
96 hi def link unisonString String
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 hi def link unisonType Type
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98 hi def link unisonTypedef Typedef
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
99
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
100
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
101 let b:current_syntax = "unison"
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
102
2200e4e8b3ae Unison support (#12715)
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 " Options for vi: ts=8 sw=2 sts=2 nowrap noexpandtab ft=vim