annotate runtime/syntax/pdf.vim @ 1937:d92bab35a167 v7.2.234

updated for version 7.2-234
author vimboss
date Tue, 14 Jul 2009 19:40:21 +0000
parents b9740fb41986
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1619
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
1 " Vim syntax file
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
2 " Language: PDF
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.info>
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
4 " Last Change: 2007 Dec 16
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
5
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
6 if exists("b:current_syntax")
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
7 finish
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
8 endif
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
9
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
10 if !exists("main_syntax")
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
11 let main_syntax = 'pdf'
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
12 endif
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
13
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
14 syn include @pdfXML syntax/xml.vim
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
15
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
16 syn case match
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
17
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
18 syn cluster pdfObjects contains=pdfBoolean,pdfConstant,pdfNumber,pdfFloat,pdfName,pdfHexString,pdfString,pdfArray,pdfHash,pdfReference,pdfComment
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
19 syn keyword pdfBoolean true false contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
20 syn keyword pdfConstant null contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
21 syn match pdfNumber "[+-]\=\<\d\+\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
22 syn match pdfFloat "[+-]\=\<\%(\d\+\.\|\d*\.\d\+\)\>" contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
23
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
24 syn match pdfNameError "#\X\|#\x\X\|#00" contained containedin=pdfName
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
25 syn match pdfSpecialChar "#\x\x" contained containedin=pdfName
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
26 syn match pdfName "/[^[:space:]\[\](){}<>/]*" contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
27 syn match pdfHexError "[^[:space:][:xdigit:]<>]" contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
28 "syn match pdfHexString "<\s*\x[^<>]*\x\s*>" contained contains=pdfHexError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
29 "syn match pdfHexString "<\s*\x\=\s*>" contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
30 syn region pdfHexString matchgroup=pdfDelimiter start="<<\@!" end=">" contained contains=pdfHexError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
31 syn match pdfStringError "\\." contained containedin=pdfString
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
32 syn match pdfSpecialChar "\\\%(\o\{1,3\}\|[nrtbf()\\]\)" contained containedin=pdfString
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
33 syn region pdfString matchgroup=pdfDelimiter start="\\\@<!(" end="\\\@<!)" contains=pdfString
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
34
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
35 syn region pdfArray matchgroup=pdfOperator start="\[" end="\]" contains=@pdfObjects contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
36 syn region pdfHash matchgroup=pdfOperator start="<<" end=">>" contains=@pdfObjects contained
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
37 syn match pdfReference "\<\d\+\s\+\d\+\s\+R\>"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
38 "syn keyword pdfOperator R contained containedin=pdfReference
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
39
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
40 syn region pdfObject matchgroup=pdfType start="\<obj\>" end="\<endobj\>" contains=@pdfObjects
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
41 syn region pdfObject matchgroup=pdfType start="\<obj\r\=\n" end="\<endobj\>" contains=@pdfObjects fold
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
42
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
43 " Do these twice. The ones with only newlines are foldable
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
44 syn region pdfStream matchgroup=pdfType start="\<stream\r\=\n" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
45 syn region pdfXMLStream matchgroup=pdfType start="\<stream\r\=\n\_s*\%(<?\)\@=" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject contains=@pdfXML
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
46 syn region pdfStream matchgroup=pdfType start="\<stream\n" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject fold
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
47 syn region pdfXMLStream matchgroup=pdfType start="\<stream\n\_s*\%(<?\)\@=" end="endstream\s*\%(\r\|\n\|\r\n\)" contained containedin=pdfObject contains=@pdfXML fold
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
48
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
49 syn region pdfPreProc start="\<xref\%(\r\|\n\|\r\n\)" end="^trailer\%(\r\|\n\|\r\n\)" skipwhite skipempty nextgroup=pdfHash contains=pdfNumber fold
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
50 syn keyword pdfPreProc startxref
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
51 syn match pdfComment "%.*\%(\r\|\n\)" contains=pdfPreProc
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
52 syn match pdfPreProc "^%\%(%EOF\|PDF-\d\.\d\)\(\r\|\n\)"
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
53
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
54 hi def link pdfOperator Operator
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
55 hi def link pdfNumber Number
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
56 hi def link pdfFloat Float
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
57 hi def link pdfBoolean Boolean
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
58 hi def link pdfConstant Constant
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
59 hi def link pdfName Identifier
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
60 hi def link pdfNameError pdfStringError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
61 hi def link pdfHexString pdfString
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
62 hi def link pdfHexError pdfStringError
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
63 hi def link pdfString String
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
64 hi def link pdfStringError Error
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
65 hi def link pdfSpecialChar SpecialChar
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
66 hi def link pdfDelimiter Delimiter
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
67 hi def link pdfType Type
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
68 hi def link pdfReference Tag
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
69 hi def link pdfStream NonText
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
70 hi def link pdfPreProc PreProc
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
71 hi def link pdfComment Comment
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
72
b9740fb41986 updated for version 7.2a
vimboss
parents:
diff changeset
73 let b:current_syntax = "pdf"