diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2024-12-31 11:53:02 +0100 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2024-12-31 12:29:35 +0100 |
| commit | 1877cd5fcdc0bbe5f3d0685d42d4e295fb819724 (patch) | |
| tree | b0171f103d6e42e5c71cf1b688565e7dd56f9273 /runtime/syntax/lnk.vim | |
| parent | 7ecd348b3da3bd27a0dd8db07896bf17a86bb26c (diff) | |
| download | rneovim-1877cd5fcdc0bbe5f3d0685d42d4e295fb819724.tar.gz rneovim-1877cd5fcdc0bbe5f3d0685d42d4e295fb819724.tar.bz2 rneovim-1877cd5fcdc0bbe5f3d0685d42d4e295fb819724.zip | |
vim-patch:9.1.0982: TI linker files are not recognized
Problem: TI linker files are not recognized
Solution: inspect '*.cmd' files and detect TI linker files
as 'lnk' filetype, include a lnk ftplugin and syntax
script (Wu, Zhenyu)
closes: vim/vim#16320
https://github.com/vim/vim/commit/39a4eb0b2ca901b59800fad086550053556e59dc
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Diffstat (limited to 'runtime/syntax/lnk.vim')
| -rw-r--r-- | runtime/syntax/lnk.vim | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/runtime/syntax/lnk.vim b/runtime/syntax/lnk.vim new file mode 100644 index 0000000000..45ca382aca --- /dev/null +++ b/runtime/syntax/lnk.vim @@ -0,0 +1,40 @@ +" Vim syntax file +" Language: TI linker command file +" Document: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html +" Document: https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Last Change: 2024 Dec 31 + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/cmacro.vim + +syn case ignore +syn match lnkNumber "0x[0-9a-f]\+" +" Linker command files are ASCII files that contain one or more of the following: +" Input filenames, which specify object files, archive libraries, or other command files. +" Linker options, which can be used in the command file in the same manner that they are used on the command line +syn match lnkOption "^[-+][-_a-zA-Z#@]\+" +syn match lnkOption "^--[^ \t$=`'"|);]\+" +syn match lnkFile '[^ =]\+\%(\.\S\+\)\+\>' +syn match lnkLibFile '[^ =]\+\.lib\>' +" 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.) +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 +syn region lnkLibrary start=+<+ end=+>+ +syn match lnkAttrib '\<[RWXI]\+\>' +syn match lnkSections '\<\.\k\+' +" Assignment statements, which define and assign values to global symbols +syn case match + +hi def link lnkNumber Number +hi def link lnkOption Special +hi def link lnkKeyword Keyword +hi def link lnkLibrary String +hi def link lnkFile String +hi def link lnkLibFile Special +hi def link lnkAttrib Type +hi def link lnkSections Macro + +let b:current_syntax = "lnk" |