Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Intel hex MCS51 |
| 3 | " Maintainer: Sams Ricahrd <sams@ping.at> |
| 4 | " Last Change: 2003 Apr 25 |
| 5 | |
| 6 | " For version 5.x: Clear all syntax items |
| 7 | " For version 6.x: Quit when a syntax file was already loaded |
| 8 | if version < 600 |
| 9 | syntax clear |
| 10 | elseif exists("b:current_syntax") |
| 11 | finish |
| 12 | endif |
| 13 | |
| 14 | syn case ignore |
| 15 | |
| 16 | " storage types |
| 17 | |
| 18 | syn match hexChecksum "[0-9a-fA-F]\{2}$" |
| 19 | syn match hexAdress "^:[0-9a-fA-F]\{6}" contains=hexDataByteCount |
| 20 | syn match hexRecType "^:[0-9a-fA-F]\{8}" contains=hexAdress |
| 21 | syn match hexDataByteCount contained "^:[0-9a-fA-F]\{2}" contains=hexStart |
| 22 | syn match hexStart contained "^:" |
| 23 | syn match hexExtAdrRec "^:02000002[0-9a-fA-F]\{4}" contains=hexSpecRec |
| 24 | syn match hexExtLinAdrRec "^:02000004[0-9a-fA-F]\{4}" contains=hexSpecRec |
| 25 | syn match hexSpecRec contained "^:0[02]00000[124]" contains=hexStart |
| 26 | syn match hexEOF "^:00000001" contains=hexStart |
| 27 | |
| 28 | syn case match |
| 29 | |
| 30 | " Define the default highlighting. |
| 31 | " For version 5.7 and earlier: only when not done already |
| 32 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 33 | if version >= 508 || !exists("did_hex_syntax_inits") |
| 34 | if version < 508 |
| 35 | let did_hex_syntax_inits = 1 |
| 36 | command -nargs=+ HiLink hi link <args> |
| 37 | else |
| 38 | command -nargs=+ HiLink hi def link <args> |
| 39 | endif |
| 40 | |
| 41 | " The default methods for highlighting. Can be overridden later |
| 42 | HiLink hexStart SpecialKey |
| 43 | HiLink hexDataByteCount Constant |
| 44 | HiLink hexAdress Comment |
| 45 | HiLink hexRecType WarningMsg |
| 46 | HiLink hexChecksum Search |
| 47 | HiLink hexExtAdrRec hexAdress |
| 48 | HiLink hexEOF hexSpecRec |
| 49 | HiLink hexExtLinAdrRec hexAdress |
| 50 | HiLink hexSpecRec DiffAdd |
| 51 | |
| 52 | delcommand HiLink |
| 53 | endif |
| 54 | |
| 55 | let b:current_syntax = "hex" |
| 56 | |
| 57 | " vim: ts=8 |