Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " 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 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 7 | " quit when a syntax file was already loaded |
| 8 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9 | finish |
| 10 | endif |
| 11 | |
| 12 | " Product specification files are case sensitive |
| 13 | syn case match |
| 14 | |
| 15 | syn keyword psfObject bundle category control_file depot distribution |
| 16 | syn keyword psfObject end file fileset host installed_software media |
| 17 | syn keyword psfObject product root subproduct vendor |
| 18 | |
| 19 | syn match psfUnquotString +[^"# ][^#]*+ contained |
| 20 | syn region psfQuotString start=+"+ skip=+\\"+ end=+"+ contained |
| 21 | |
| 22 | syn match psfObjTag "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*" contained |
| 23 | syn match psfAttAbbrev ",\<\(fa\|fr\|[aclqrv]\)\(<\|>\|<=\|>=\|=\|==\)[^,]\+" contained |
| 24 | syn match psfObjTags "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\(\s\+\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\)*" contained |
| 25 | |
| 26 | syn match psfNumber "\<\d\+\>" contained |
| 27 | syn match psfFloat "\<\d\+\>\(\.\<\d\+\>\)*" contained |
| 28 | |
| 29 | syn match psfLongDate "\<\d\d\d\d\d\d\d\d\d\d\d\d\.\d\d\>" contained |
| 30 | |
| 31 | syn keyword psfState available configured corrupt installed transient contained |
| 32 | syn keyword psfPState applied committed superseded contained |
| 33 | |
| 34 | syn keyword psfBoolean false true contained |
| 35 | |
| 36 | |
| 37 | "Some of the attributes covered by attUnquotString and attQuotString: |
| 38 | " architecture category_tag control_directory copyright |
| 39 | " create_date description directory file_permissions install_source |
| 40 | " install_type location machine_type mod_date number os_name os_release |
| 41 | " os_version pose_as_os_name pose_as_os_release readme revision |
| 42 | " share_link title vendor_tag |
| 43 | syn region psfAttUnquotString matchgroup=psfAttrib start=~^\s*[^# ]\+\s\+[^#" ]~rs=e-1 contains=psfUnquotString,psfComment end=~$~ keepend oneline |
| 44 | |
| 45 | syn region psfAttQuotString matchgroup=psfAttrib start=~^\s*[^# ]\+\s\+"~rs=e-1 contains=psfQuotString,psfComment skip=~\\"~ matchgroup=psfQuotString end=~"~ keepend |
| 46 | |
| 47 | |
| 48 | " These regions are defined in attempt to do syntax checking for some |
| 49 | " of the attributes. |
| 50 | syn region psfAttTag matchgroup=psfAttrib start="^\s*tag\s\+" contains=psfObjTag,psfComment end="$" keepend oneline |
| 51 | |
| 52 | syn 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 |
| 53 | |
| 54 | syn region psfAttTags matchgroup=psfAttrib start="^\s*all_filesets\s\+" contains=psfObjTags,psfComment end="$" keepend |
| 55 | |
| 56 | syn region psfAttNumber matchgroup=psfAttrib start="^\s*\(compressed_size\|instance_id\|media_sequence_number\|sequence_number\|size\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline |
| 57 | |
| 58 | syn region psfAttTime matchgroup=psfAttrib start="^\s*\(create_time\|ctime\|mod_time\|mtime\|timestamp\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline |
| 59 | |
| 60 | syn region psfAttFloat matchgroup=psfAttrib start="^\s*\(data_model_revision\|layout_version\)\s\+" contains=psfFloat,psfComment end="$" keepend oneline |
| 61 | |
| 62 | syn region psfAttLongDate matchgroup=psfAttrib start="^\s*install_date\s\+" contains=psfLongDate,psfComment end="$" keepend oneline |
| 63 | |
| 64 | syn region psfAttState matchgroup=psfAttrib start="^\s*\(state\)\s\+" contains=psfState,psfComment end="$" keepend oneline |
| 65 | |
| 66 | syn region psfAttPState matchgroup=psfAttrib start="^\s*\(patch_state\)\s\+" contains=psfPState,psfComment end="$" keepend oneline |
| 67 | |
| 68 | syn 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 |
| 69 | |
| 70 | syn match psfComment "#.*$" |
| 71 | |
| 72 | |
| 73 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 74 | " Only when an item doesn't have highlighting yet |
| 75 | command -nargs=+ HiLink hi def link <args> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 76 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 77 | HiLink psfObject Statement |
| 78 | HiLink psfAttrib Type |
| 79 | HiLink psfQuotString String |
| 80 | HiLink psfObjTag Identifier |
| 81 | HiLink psfAttAbbrev PreProc |
| 82 | HiLink psfObjTags Identifier |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 83 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 84 | HiLink psfComment Comment |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 85 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 86 | delcommand HiLink |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 87 | |
| 88 | " Long descriptions and copyrights confuse the syntax highlighting, so |
| 89 | " force vim to backup at least 100 lines before the top visible line |
| 90 | " looking for a sync location. |
| 91 | syn sync lines=100 |
| 92 | |
| 93 | let b:current_syntax = "psf" |