1" Vim syntax file
2" Language:     mgp - MaGic Point
3" Maintainer:   Gerfried Fuchs <alfie@ist.org>
4" Filenames:    *.mgp
5" Last Change:  25 Apr 2001
6" URL:		http://alfie.ist.org/vim/syntax/mgp.vim
7"
8" Comments are very welcome - but please make sure that you are commenting on
9" the latest version of this file.
10" SPAM is _NOT_ welcome - be ready to be reported!
11
12
13" For version 5.x: Clear all syntax items
14" For version 6.x: Quit when a syntax file was already loaded
15if version < 600
16  syn clear
17elseif exists("b:current_syntax")
18  finish
19endif
20
21
22syn match mgpLineSkip "\\$"
23
24" all the commands that are currently recognized
25syn keyword mgpCommand contained size fore back bgrad left leftfill center
26syn keyword mgpCommand contained right shrink lcutin rcutin cont xfont vfont
27syn keyword mgpCommand contained tfont tmfont tfont0 bar image newimage
28syn keyword mgpCommand contained prefix icon bimage default tab vgap hgap
29syn keyword mgpCommand contained pause mark again system filter endfilter
30syn keyword mgpCommand contained vfcap tfdir deffont font embed endembed
31syn keyword mgpCommand contained noop pcache include
32
33" charset is not yet supported :-)
34" syn keyword mgpCommand contained charset
35
36syn region mgpFile     contained start=+"+ skip=+\\\\\|\\"+ end=+"+
37syn match mgpValue     contained "\d\+"
38syn match mgpSize      contained "\d\+x\d\+"
39syn match mgpLine      +^%.*$+ contains=mgpCommand,mgpFile,mgpSize,mgpValue
40
41" Comments
42syn match mgpPercent   +^%%.*$+
43syn match mgpHash      +^#.*$+
44
45" these only work alone
46syn match mgpPage      +^%page$+
47syn match mgpNoDefault +^%nodefault$+
48
49
50" Define the default highlighting.
51" For version 5.7 and earlier: only when not done already
52" For version 5.8 and later: only when an item doesn't have highlighting yet
53if version >= 508 || !exists("did_mgp_syn_inits")
54  let did_mgp_syn_inits = 1
55  if version < 508
56    let did_mgp_syn_inits = 1
57    command -nargs=+ HiLink hi link <args>
58  else
59    command -nargs=+ HiLink hi def link <args>
60  endif
61
62  HiLink mgpLineSkip	Special
63
64  HiLink mgpHash	mgpComment
65  HiLink mgpPercent	mgpComment
66  HiLink mgpComment	Comment
67
68  HiLink mgpCommand	Identifier
69
70  HiLink mgpLine	Type
71
72  HiLink mgpFile	String
73  HiLink mgpSize	Number
74  HiLink mgpValue	Number
75
76  HiLink mgpPage	mgpDefine
77  HiLink mgpNoDefault	mgpDefine
78  HiLink mgpDefine	Define
79
80  delcommand HiLink
81endif
82
83let b:current_syntax = "mgp"
84