/usr/share/highlight/langDefs/pdf.lang is in highlight-common 3.18-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | -- vim: set ft=lua ts=2 sw=2 et :
-- Language definition for PDF files
-- Author: Roland Hieber <rohieb@rohieb.name>
-- Date: 2013-11-22
-- Known Bugs:
-- * Does not highlight files with MacOS (CR-only) line endings
-- * Does not (yet) highlight inside streams due to limitations in the library
--
Description="Highlighting definitions for the Portable Document Format (PDF)"
IgnoreCase=false
-- File Structure
PreProcessor={
Prefix=[[%PDF-[0-9]\.[0-9]|%%EOF|xref|startxref|trailer]]
}
-- Comments. But do not match file structure elements.
Comments={
{ Block=false,
Delimiter={ [[%(?!PDF-[0-9]\.[0-9]|%EOF)]] },
},
}
-- Numbers: 0.45, +1.34, -.4, 123, 4., and so on.
Digits=[[ [-+]?\.[0-9]+|[-+]?[0-9]+\.?[0-9]* ]]
-- Strings: (string), <hex> and streams
Strings={
DelimiterPairs= {
{ Open=[[ \( ]], Close=[[ \) ]] },
{ Open=[[ < ]], Close=[[ > ]] },
{ Open=[[ ^stream ]], Close=[[ ^endstream ]], Raw=true },
}
}
-- Note: we highlight dictionary and array syntax as "keywords", so we have to
-- include them in Identifiers. This definition basically matches the allowed
-- characters for Names. Also, we do not want to match Numbers, Streams,
-- References and file structure elements as identifiers
Identifiers=[[ (?!%PDF-[0-9]\.[0-9]|%%EOF|xref|startxref|trailer|[0-9]+\s+[0-9]+\s+(R|obj)|[-+]?\.[0-9]+|[-+]?[0-9]+\.?[0-9]*)[^\s\[\]\(\){}<>/%]+ ]]
Keywords={
-- Indirect Objects
{ Id=1,
Regex=[[ [0-9]+\s+[0-9]+\s+(obj|R)|endobj]],
Group=0
},
-- Arrays and Dictionaries
{ Id=2,
Regex=[[ \[|\]|<<|>> ]],
},
-- Names
{ Id=3,
Regex=[[ /[^\s\[\]\(\){}<>/%]+ ]],
},
-- Constants
{ Id=4,
--List={"true", "false", "null"},
Regex=[[ true|false|null ]],
},
}
|