2 " Language: Slrn score file (based on slrn 0.9.8.0)
3 " Maintainer: Preben 'Peppe' Guldberg <peppe@wielders.org>
4 " Last Change: 8 Oct 2004
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " characters in newsgroup names
16 set isk=@,48-57,.,-,_,+
18 setlocal isk=@,48-57,.,-,_,+
21 syn match slrnscComment "%.*$"
22 syn match slrnscSectionCom ".].*"lc=2
24 syn match slrnscGroup contained "\(\k\|\*\)\+"
25 syn match slrnscNumber contained "\d\+"
26 syn match slrnscDate contained "\(\d\{1,2}[-/]\)\{2}\d\{4}"
27 syn match slrnscDelim contained ":"
28 syn match slrnscComma contained ","
29 syn match slrnscOper contained "\~"
30 syn match slrnscEsc contained "\\[ecC<>.]"
31 syn match slrnscEsc contained "[?^]"
32 syn match slrnscEsc contained "[^\\]$\s*$"lc=1
34 syn keyword slrnscInclude contained include
35 syn match slrnscIncludeLine "^\s*Include\s\+\S.*$"
37 syn region slrnscSection matchgroup=slrnscSectionStd start="^\s*\[" end='\]' contains=slrnscGroup,slrnscComma,slrnscSectionCom
38 syn region slrnscSection matchgroup=slrnscSectionNot start="^\s*\[\~" end='\]' contains=slrnscGroup,slrnscCommas,slrnscSectionCom
40 syn keyword slrnscItem contained Age Bytes Date Expires From Has-Body Lines Message-Id Newsgroup References Subject Xref
42 syn match slrnscScoreItem contained "%.*$" skipempty nextgroup=slrnscScoreItem contains=slrnscComment
43 syn match slrnscScoreItem contained "^\s*Expires:\s*\(\d\{1,2}[-/]\)\{2}\d\{4}\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscItem,slrnscDelim,slrnscDate
44 syn match slrnscScoreItem contained "^\s*\~\=\(Age\|Bytes\|Has-Body\|Lines\):\s*\d\+\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscOper,slrnscItem,slrnscDelim,slrnscNumber
45 syn match slrnscScoreItemFill contained ".*$" skipempty nextgroup=slrnscScoreItem contains=slrnscEsc
46 syn match slrnscScoreItem contained "^\s*\~\=\(Date\|From\|Message-Id\|Newsgroup\|References\|Subject\|Xref\):" nextgroup=slrnscScoreItemFill contains=slrnscOper,slrnscItem,slrnscDelim
47 syn region slrnscScoreItem contained matchgroup=Special start="^\s*\~\={::\=" end="^\s*}" skipempty nextgroup=slrnscScoreItem contains=slrnscScoreItem
49 syn keyword slrnscScore contained Score
50 syn match slrnscScoreIdent contained "%.*"
51 syn match slrnScoreLine "^\s*Score::\=\s\+=\=[-+]\=\d\+\s*\(%.*\)\=$" skipempty nextgroup=slrnscScoreItem contains=slrnscScore,slrnscDelim,slrnscOper,slrnscNumber,slrnscScoreIdent
53 " Define the default highlighting.
54 " For version 5.7 and earlier: only when not done already
55 " For version 5.8 and later: only when an item doesn't have highlighting yet
56 if version >= 508 || !exists("did_slrnsc_syntax_inits")
58 let did_slrnsc_syntax_inits = 1
59 command -nargs=+ HiLink hi link <args>
61 command -nargs=+ HiLink hi def link <args>
64 HiLink slrnscComment Comment
65 HiLink slrnscSectionCom slrnscComment
66 HiLink slrnscGroup String
67 HiLink slrnscNumber Number
68 HiLink slrnscDate Special
69 HiLink slrnscDelim Delimiter
70 HiLink slrnscComma SpecialChar
71 HiLink slrnscOper SpecialChar
72 HiLink slrnscEsc String
73 HiLink slrnscSectionStd Type
74 HiLink slrnscSectionNot Delimiter
75 HiLink slrnscItem Statement
76 HiLink slrnscScore Keyword
77 HiLink slrnscScoreIdent Identifier
78 HiLink slrnscInclude Keyword
83 let b:current_syntax = "slrnsc"
85 "EOF vim: ts=8 noet tw=200 sw=8 sts=0