annotate runtime/syntax/cabal.vim @ 29019:7cf98b61e022

Added tag v8.2.5031 for changeset 4a7650a894d4376260a962835646451aa5c79e09
author Bram Moolenaar <Bram@vim.org>
date Fri, 27 May 2022 21:15:03 +0200
parents 29c5f168c6fd
children 5acd6f02ea35
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
1 " Vim syntax file
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
2 " Language: Haskell Cabal Build file
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
3 " Author: Vincent Berthoux <twinside@gmail.com>
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
4 " Maintainer: Marcin Szamotulski <profunctor@pm.me>
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
5 " Previous Maintainer: Vincent Berthoux <twinside@gmail.com>
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
6 " File Types: .cabal
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
7 " Last Change: 21 Nov 2020
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
8 " v1.5: Incorporated changes from
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
9 " https://github.com/sdiehl/haskell-vim-proto/blob/master/vim/syntax/cabal.vim
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
10 " Use `syn keyword` instead of `syn match`.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
11 " Added cabalStatementRegion to limit matches of keywords, which fixes
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
12 " the highlighting of description's value.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
13 " Added cabalVersionRegion to limit the scope of cabalVersionOperator
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
14 " and cabalVersion matches.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
15 " Added cabalLanguage keyword.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
16 " Added calbalTitle, cabalAuthor and cabalMaintainer syntax groups.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
17 " Added ! and ^>= operators (calbal 2.0)
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
18 " Added build-type keywords
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
19 " v1.4: Add benchmark support, thanks to Simon Meier
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
20 " v1.3: Updated to the last version of cabal
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
21 " Added more highlighting for cabal function, true/false
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
22 " and version number. Also added missing comment highlighting.
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
23 " Cabal known compiler are highlighted too.
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
24 "
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
25 " V1.2: Added cpp-options which was missing. Feature implemented
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
26 " by GHC, found with a GHC warning, but undocumented.
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
27 " Whatever...
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
28 "
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
29 " v1.1: Fixed operator problems and added ftdetect file
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
30 " (thanks to Sebastian Schwarz)
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
31 "
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
32 " v1.0: Cabal syntax in vimball format
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
33 " (thanks to Magnus Therning)
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
34
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2206
diff changeset
35 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2206
diff changeset
36 if exists("b:current_syntax")
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
37 finish
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
38 endif
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
39
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
40 " this file uses line continuation
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
41 let s:cpo_save = &cpo
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
42 set cpo&vim
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
43
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
44 " set iskeyword for this syntax script
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
45 syn iskeyword @,48-57,192-255,-
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
46
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
47 " Case sensitive matches
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
48 syn case match
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
49
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
50 syn keyword cabalConditional if else
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
51 syn keyword cabalFunction os arche impl flag
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
52 syn match cabalComment /--.*$/
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
53
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
54 " Case insensitive matches
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
55 syn case ignore
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
56
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
57 syn keyword cabalCategory contained
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
58 \ executable
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
59 \ library
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
60 \ benchmark
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
61 \ test-suite
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
62 \ source-repository
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
63 \ flag
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
64 \ custom-setup
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13960
diff changeset
65 \ common
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
66 syn match cabalCategoryTitle contained /[^{]*\ze{\?/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
67 syn match cabalCategoryRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
68 \ contains=cabalCategory,cabalCategoryTitle
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
69 \ nextgroup=cabalCategory skipwhite
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13960
diff changeset
70 \ /^\c\s*\(contained\|executable\|library\|benchmark\|test-suite\|source-repository\|flag\|custom-setup\|common\)\+\s*\%(.*$\|$\)/
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
71 syn keyword cabalTruth true false
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
72
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
73 " cabalStatementRegion which limits the scope of cabalStatement keywords, this
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
74 " way they are not highlighted in description.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
75 syn region cabalStatementRegion start=+^\s*\(--\)\@<!\k\+\s*:+ end=+:+
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
76 syn keyword cabalStatement contained containedin=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
77 \ default-language
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
78 \ default-extensions
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
79 \ author
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13960
diff changeset
80 \ autogen-modules
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
81 \ asm-sources
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
82 \ asm-options
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
83 \ branch
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
84 \ bug-reports
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
85 \ build-depends
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
86 \ build-tools
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
87 \ build-tools-depends
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
88 \ build-type
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
89 \ buildable
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
90 \ c-sources
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
91 \ cabal-version
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
92 \ category
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
93 \ cc-options
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
94 \ copyright
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
95 \ cmm-sources
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
96 \ cmm-options
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
97 \ cpp-options
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
98 \ cxx-sources
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
99 \ data-dir
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
100 \ data-files
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
101 \ default
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
102 \ default-extensions
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
103 \ description
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
104 \ executable
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
105 \ exposed-modules
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
106 \ exposed
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
107 \ extensions
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
108 \ extra-bundled-libraries
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
109 \ extra-doc-files
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
110 \ extra-dynamic-library-flavours
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
111 \ extra-framework-dirs
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
112 \ extra-ghci-libraries
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
113 \ extra-lib-dirs
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
114 \ extra-libraries
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
115 \ extra-library-flavours
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
116 \ extra-source-files
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
117 \ extra-tmp-files
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
118 \ for example
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
119 \ frameworks
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
120 \ ghc-options
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
121 \ ghc-prof-options
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
122 \ ghc-shared-options
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
123 \ ghcjs-options
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
124 \ ghcjs-prof-options
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
125 \ ghcjs-shared-options
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
126 \ homepage
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
127 \ hs-source-dir
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
128 \ hs-source-dirs
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
129 \ hugs-options
22565
17c4178f26ea Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 13960
diff changeset
130 \ import
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
131 \ include-dirs
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
132 \ includes
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
133 \ install-includes
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
134 \ js-sources
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
135 \ ld-options
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
136 \ license
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
137 \ license-file
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
138 \ location
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
139 \ main-is
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
140 \ maintainer
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
141 \ manual
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
142 \ mixins
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
143 \ module
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
144 \ name
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
145 \ nhc98-options
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
146 \ other-extensions
23047
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
147 \ other-language
29c5f168c6fd Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22565
diff changeset
148 \ other-languages
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
149 \ other-modules
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
150 \ package-url
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
151 \ pkgconfig-depends
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
152 \ setup-depends
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
153 \ stability
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
154 \ subdir
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
155 \ synopsis
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
156 \ tag
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
157 \ tested-with
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
158 \ type
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
159 \ version
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
160 \ virtual-modules
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
161
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
162 " operators and version operators
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
163 syn match cabalOperator /&&\|||\|!/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
164 syn match cabalVersionOperator contained
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
165 \ /!\|==\|\^\?>=\|<=\|<\|>/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
166 " match version: `[%]\@<!` is to exclude `%20` in http addresses.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
167 syn match cabalVersion contained
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
168 \ /[%$_-]\@<!\<\d\+\%(\.\d\+\)*\%(\.\*\)\?\>/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
169 " cabalVersionRegion which limits the scope of cabalVersion pattern.
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
170 syn match cabalVersionRegionA
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
171 \ contains=cabalVersionOperator,cabalVersion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
172 \ keepend
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
173 \ /\%(==\|\^\?>=\|<=\|<\|>\)\s*\d\+\%(\.\d\+\)*\%(\.\*\)\?\>/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
174 " version inside `version: ...`
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
175 syn match cabalVersionRegionB
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
176 \ contains=cabalStatementRegion,cabalVersionOperator,cabalVersion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
177 \ /^\s*\%(cabal-\)\?version\s*:.*$/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
178
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
179 syn keyword cabalLanguage Haskell98 Haskell2010
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
180
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
181 " title region
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
182 syn match cabalName contained /:\@<=.*/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
183 syn match cabalNameRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
184 \ contains=cabalStatementRegion,cabalName
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
185 \ nextgroup=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
186 \ oneline
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
187 \ /^\c\s*name\s*:.*$/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
188
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
189 " author region
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
190 syn match cabalAuthor contained /:\@<=.*/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
191 syn match cabalAuthorRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
192 \ contains=cabalStatementRegion,cabalStatement,cabalAuthor
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
193 \ nextgroup=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
194 \ oneline
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
195 \ /^\c\s*author\s*:.*$/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
196
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
197 " maintainer region
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
198 syn match cabalMaintainer contained /:\@<=.*/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
199 syn match cabalMaintainerRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
200 \ contains=cabalStatementRegion,cabalStatement,cabalMaintainer
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
201 \ nextgroup=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
202 \ oneline
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
203 \ /^\c\s*maintainer\s*:.*$/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
204
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
205 " license region
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
206 syn match cabalLicense contained /:\@<=.*/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
207 syn match cabalLicenseRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
208 \ contains=cabalStatementRegion,cabalStatement,cabalLicense
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
209 \ nextgroup=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
210 \ oneline
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
211 \ /^\c\s*license\s*:.*$/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
212
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
213 " license-file region
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
214 syn match cabalLicenseFile contained /:\@<=.*/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
215 syn match cabalLicenseFileRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
216 \ contains=cabalStatementRegion,cabalStatement,cabalLicenseFile
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
217 \ nextgroup=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
218 \ oneline
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
219 \ /^\c\s*license-file\s*:.*$/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
220
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
221 " tested-with region with compilers and versions
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
222 syn keyword cabalCompiler contained ghc nhc yhc hugs hbc helium jhc lhc
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
223 syn match cabalTestedWithRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
224 \ contains=cabalStatementRegion,cabalStatement,cabalCompiler,cabalVersionRegionA
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
225 \ nextgroup=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
226 \ oneline
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
227 \ /^\c\s*tested-with\s*:.*$/
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
228
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
229 " build type keywords
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
230 syn keyword cabalBuildType contained
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
231 \ simple custom configure
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
232 syn match cabalBuildTypeRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
233 \ contains=cabalStatementRegion,cabalStatement,cabalBuildType
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
234 \ nextgroup=cabalStatementRegion
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
235 \ /^\c\s*build-type\s*:.*$/
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
236
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
237 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2206
diff changeset
238 " Only when an item doesn't have highlighting yet
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
239 hi def link cabalName Title
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
240 hi def link cabalAuthor Normal
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
241 hi def link cabalMaintainer Normal
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
242 hi def link cabalCategoryTitle Title
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
243 hi def link cabalLicense Normal
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
244 hi def link cabalLicenseFile Normal
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
245 hi def link cabalBuildType Keyword
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
246 hi def link cabalVersion Number
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
247 hi def link cabalTruth Boolean
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
248 hi def link cabalComment Comment
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
249 hi def link cabalStatement Statement
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
250 hi def link cabalLanguage Type
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
251 hi def link cabalCategory Type
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
252 hi def link cabalFunction Function
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
253 hi def link cabalConditional Conditional
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
254 hi def link cabalOperator Operator
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
255 hi def link cabalVersionOperator Operator
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
256 hi def link cabalCompiler Constant
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
257
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
258 let b:current_syntax = "cabal"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
259
13960
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
260 let &cpo = s:cpo_save
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
261 unlet! s:cpo_save
bbff863d3cae Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10051
diff changeset
262
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
263 " vim: ts=8