1" Vim syntax file
2" Language:     Debian sources.list
3" Maintainer:   Debian Vim Maintainers <[email protected]>
4" Former Maintainer: Matthijs Mohlmann <[email protected]>
5" Last Change: 2016 Aug 30
6" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim
7
8" Standard syntax initialization
9if exists("b:current_syntax")
10  finish
11endif
12
13" case sensitive
14syn case match
15
16" A bunch of useful keywords
17syn match debsourcesKeyword        /\(deb-src\|deb\|main\|contrib\|non-free\|restricted\|universe\|multiverse\)/
18
19" Match comments
20syn match debsourcesComment        /#.*/  contains=@Spell
21
22let s:cpo = &cpo
23set cpo-=C
24let s:supported = [
25      \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
26      \ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
27      \
28      \ 'precise', 'trusty', 'xenial', 'yakkety', 'devel'
29      \ ]
30let s:unsupported = [
31      \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
32      \ 'woody', 'sarge', 'etch', 'lenny',
33      \
34      \ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
35      \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
36      \ 'maverick', 'natty', 'oneiric', 'quantal', 'raring', 'saucy',
37      \ 'utopic', 'vivid', 'wily'
38      \ ]
39let &cpo=s:cpo
40
41" Match uri's
42syn match debsourcesUri            +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' 	<>"]\++
43exe 'syn match debsourcesDistrKeyword   +\([[:alnum:]_./]*\)\('. join(s:supported, '\|'). '\)\([-[:alnum:]_./]*\)+'
44exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:unsupported, '\|') .'\)\([-[:alnum:]_./]*\)+'
45
46" Associate our matches and regions with pretty colours
47hi def link debsourcesLine                    Error
48hi def link debsourcesKeyword                 Statement
49hi def link debsourcesDistrKeyword            Type
50hi def link debsourcesUnsupportedDistrKeyword WarningMsg
51hi def link debsourcesComment                 Comment
52hi def link debsourcesUri                     Constant
53
54let b:current_syntax = "debsources"
55