Wu, Zhenyu | 39a4eb0 | 2024-12-31 10:25:44 +0100 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: TI linker command file |
| 3 | " Document: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html |
| 4 | " Document: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html |
| 5 | " Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> |
| 6 | " Last Change: 2024 Dec 31 |
| 7 | |
| 8 | if exists("b:current_syntax") |
| 9 | finish |
| 10 | endif |
| 11 | |
| 12 | runtime! syntax/cmacro.vim |
| 13 | |
| 14 | syn case ignore |
| 15 | syn match lnkNumber "0x[0-9a-f]\+" |
| 16 | " Linker command files are ASCII files that contain one or more of the following: |
| 17 | " Input filenames, which specify object files, archive libraries, or other command files. |
| 18 | " Linker options, which can be used in the command file in the same manner that they are used on the command line |
| 19 | syn match lnkOption "^[-+][-_a-zA-Z#@]\+" |
| 20 | syn match lnkOption "^--[^ \t$=`'"|);]\+" |
| 21 | syn match lnkFile '[^ =]\+\%(\.\S\+\)\+\>' |
| 22 | syn match lnkLibFile '[^ =]\+\.lib\>' |
| 23 | " The MEMORY and SECTIONS linker directives. The MEMORY directive defines the target memory configuration (see Section 8.5.4). The SECTIONS directive controls how sections are built and allocated (see Section 8.5.5.) |
| 24 | syn keyword lnkKeyword ADDRESS_MASK f LOAD ORIGIN START ALGORITHM FILL LOAD_END PAGE TABLE ALIGN GROUP LOAD_SIZE PALIGN TYPE ATTR HAMMING_MASK LOAD_START PARITY_MASK UNION BLOCK HIGH MEMORY RUN UNORDERED COMPRESSION INPUT_PAGE MIRRORING RUN_END VFILL COPY INPUT_RANGE NOINIT RUN_SIZE DSECT l NOLOAD RUN_START ECC LEN o SECTIONS END LENGTH ORG SIZE |
| 25 | syn region lnkLibrary start=+<+ end=+>+ |
| 26 | syn match lnkAttrib '\<[RWXI]\+\>' |
| 27 | syn match lnkSections '\<\.\k\+' |
| 28 | " Assignment statements, which define and assign values to global symbols |
| 29 | syn case match |
| 30 | |
| 31 | hi def link lnkNumber Number |
| 32 | hi def link lnkOption Special |
| 33 | hi def link lnkKeyword Keyword |
| 34 | hi def link lnkLibrary String |
| 35 | hi def link lnkFile String |
| 36 | hi def link lnkLibFile Special |
| 37 | hi def link lnkAttrib Type |
| 38 | hi def link lnkSections Macro |
| 39 | |
| 40 | let b:current_syntax = "lnk" |