2 " Language: Slrn score file
3 " Maintainer: Preben "Peppe" Guldberg (c928400@student.dtu.dk)
4 " Last Change: Thu Apr 2 14:02:43 1998
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 syn match slrnscComment "%.*$"
15 syn match slrnscSectionCom ".].*"lc=2
17 " characters in newsgroup names
19 set isk=@,48-57,.,-,_,+
21 setlocal isk=@,48-57,.,-,_,+
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 region slrnscSection matchgroup=slrnscSectionStd start="^\s*\[" end='\]' contains=slrnscGroup,slrnscComma,slrnscSectionCom
35 syn region slrnscSection matchgroup=slrnscSectionNot start="^\s*\[\~" end='\]' contains=slrnscGroup,slrnscCommas,slrnscSectionCom
37 syn keyword slrnscItem contained Expires From Lines References Subject Xref
39 syn match slrnscItemFill contained ".*$" skipempty nextgroup=slrnscScoreItem contains=slrnscEsc
41 syn match slrnscScoreItem contained "^\s*Expires:\s*\(\d\{1,2}[-/]\)\{2}\d\{4}\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscItem,slrnscDelim,slrnscDate
42 syn match slrnscScoreItem contained "^\s*\~\=Lines:\s*\d\+\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscOper,slrnscItem,slrnscDelim,slrnscNumber
43 syn match slrnscScoreItem contained "^\s*\~\=\(From\|References\|Subject\|Xref\):" nextgroup=slrnscItemFill contains=slrnscOper,slrnscItem,slrnscDelim
44 syn match slrnscScoreItem contained "^\s*%.*$" skipempty nextgroup=slrnscScoreItem contains=slrnscComment
46 syn keyword slrnscScore contained Score
47 syn match slrnScoreLine "^\s*Score::\=\s\+=\=-\=\d\+\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscScore,slrnscDelim,slrnscOper,slrnscNumber
49 " Define the default highlighting.
50 " For version 5.7 and earlier: only when not done already
51 " For version 5.8 and later: only when an item doesn't have highlighting yet
52 if version >= 508 || !exists("did_slrnsc_syntax_inits")
54 let did_slrnsc_syntax_inits = 1
55 command -nargs=+ HiLink hi link <args>
57 command -nargs=+ HiLink hi def link <args>
60 HiLink slrnscComment Comment
61 HiLink slrnscSectionCom slrnscComment
62 HiLink slrnscGroup String
63 HiLink slrnscNumber Number
64 HiLink slrnscDate Special
65 HiLink slrnscDelim Delimiter
66 HiLink slrnscComma SpecialChar
67 HiLink slrnscOper SpecialChar
68 HiLink slrnscEsc String
69 HiLink slrnscSectionStd Type
70 HiLink slrnscSectionNot Delimiter
71 HiLink slrnscItem Statement
72 HiLink slrnscScore Keyword
77 let b:current_syntax = "slrnsc"
79 "EOF vim: ts=8 noet tw=200 sw=8 sts=0