blob: 2b376f94cceddacc958bae27d3e4c0677732758a [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Software Distributor product specification file
3" (POSIX 1387.2-1995).
4" Maintainer: Rex Barzee <rex_barzee@hp.com>
5" Last change: 25 Apr 2001
6
7if version < 600
8 " Remove any old syntax stuff hanging around
9 syn clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14" Product specification files are case sensitive
15syn case match
16
17syn keyword psfObject bundle category control_file depot distribution
18syn keyword psfObject end file fileset host installed_software media
19syn keyword psfObject product root subproduct vendor
20
21syn match psfUnquotString +[^"# ][^#]*+ contained
22syn region psfQuotString start=+"+ skip=+\\"+ end=+"+ contained
23
24syn match psfObjTag "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*" contained
25syn match psfAttAbbrev ",\<\(fa\|fr\|[aclqrv]\)\(<\|>\|<=\|>=\|=\|==\)[^,]\+" contained
26syn match psfObjTags "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\(\s\+\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\)*" contained
27
28syn match psfNumber "\<\d\+\>" contained
29syn match psfFloat "\<\d\+\>\(\.\<\d\+\>\)*" contained
30
31syn match psfLongDate "\<\d\d\d\d\d\d\d\d\d\d\d\d\.\d\d\>" contained
32
33syn keyword psfState available configured corrupt installed transient contained
34syn keyword psfPState applied committed superseded contained
35
36syn keyword psfBoolean false true contained
37
38
39"Some of the attributes covered by attUnquotString and attQuotString:
40" architecture category_tag control_directory copyright
41" create_date description directory file_permissions install_source
42" install_type location machine_type mod_date number os_name os_release
43" os_version pose_as_os_name pose_as_os_release readme revision
44" share_link title vendor_tag
45syn region psfAttUnquotString matchgroup=psfAttrib start=~^\s*[^# ]\+\s\+[^#" ]~rs=e-1 contains=psfUnquotString,psfComment end=~$~ keepend oneline
46
47syn region psfAttQuotString matchgroup=psfAttrib start=~^\s*[^# ]\+\s\+"~rs=e-1 contains=psfQuotString,psfComment skip=~\\"~ matchgroup=psfQuotString end=~"~ keepend
48
49
50" These regions are defined in attempt to do syntax checking for some
51" of the attributes.
52syn region psfAttTag matchgroup=psfAttrib start="^\s*tag\s\+" contains=psfObjTag,psfComment end="$" keepend oneline
53
54syn region psfAttSpec matchgroup=psfAttrib start="^\s*\(ancestor\|applied_patches\|applied_to\|contents\|corequisites\|exrequisites\|prerequisites\|software_spec\|supersedes\|superseded_by\)\s\+" contains=psfObjTag,psfAttAbbrev,psfComment end="$" keepend
55
56syn region psfAttTags matchgroup=psfAttrib start="^\s*all_filesets\s\+" contains=psfObjTags,psfComment end="$" keepend
57
58syn region psfAttNumber matchgroup=psfAttrib start="^\s*\(compressed_size\|instance_id\|media_sequence_number\|sequence_number\|size\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline
59
60syn region psfAttTime matchgroup=psfAttrib start="^\s*\(create_time\|ctime\|mod_time\|mtime\|timestamp\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline
61
62syn region psfAttFloat matchgroup=psfAttrib start="^\s*\(data_model_revision\|layout_version\)\s\+" contains=psfFloat,psfComment end="$" keepend oneline
63
64syn region psfAttLongDate matchgroup=psfAttrib start="^\s*install_date\s\+" contains=psfLongDate,psfComment end="$" keepend oneline
65
66syn region psfAttState matchgroup=psfAttrib start="^\s*\(state\)\s\+" contains=psfState,psfComment end="$" keepend oneline
67
68syn region psfAttPState matchgroup=psfAttrib start="^\s*\(patch_state\)\s\+" contains=psfPState,psfComment end="$" keepend oneline
69
70syn region psfAttBoolean matchgroup=psfAttrib start="^\s*\(is_kernel\|is_locatable\|is_patch\|is_protected\|is_reboot\|is_reference\|is_secure\|is_sparse\)\s\+" contains=psfBoolean,psfComment end="$" keepend oneline
71
72syn match psfComment "#.*$"
73
74
75" Define the default highlighting.
76" For version 5.7 and earlier: only when not done already
77" For version 5.8 and later: only when an item doesn't have highlighting yet
78if version >= 508 || !exists("did_psf_syntax_inits")
79 if version < 508
80 let did_psf_syntax_inits = 1
81 command -nargs=+ HiLink hi link <args>
82 else
83 command -nargs=+ HiLink hi def link <args>
84 endif
85
86 HiLink psfObject Statement
87 HiLink psfAttrib Type
88 HiLink psfQuotString String
89 HiLink psfObjTag Identifier
90 HiLink psfAttAbbrev PreProc
91 HiLink psfObjTags Identifier
92
93 HiLink psfComment Comment
94
95 delcommand HiLink
96endif
97
98" Long descriptions and copyrights confuse the syntax highlighting, so
99" force vim to backup at least 100 lines before the top visible line
100" looking for a sync location.
101syn sync lines=100
102
103let b:current_syntax = "psf"