aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/ftplugin/lnkmap.vim16
-rw-r--r--runtime/lua/vim/filetype.lua2
-rw-r--r--runtime/syntax/lnkmap.vim35
3 files changed, 52 insertions, 1 deletions
diff --git a/runtime/ftplugin/lnkmap.vim b/runtime/ftplugin/lnkmap.vim
new file mode 100644
index 0000000000..46fb070e71
--- /dev/null
+++ b/runtime/ftplugin/lnkmap.vim
@@ -0,0 +1,16 @@
+" Vim filetype plugin file
+" Language: TI Linker map
+" Document: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html
+" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
+" Last Change: 2024 Dec 25
+
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl iskeyword<"
+
+setl iskeyword+=.
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index f267e5ef6f..ef77a560d8 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -736,7 +736,7 @@ local extension = {
mk = detect.make,
mak = detect.make,
page = 'mallard',
- map = 'map',
+ map = detect_line1('^%*+$', 'lnkmap', 'map'),
mws = 'maple',
mpl = 'maple',
mv = 'maple',
diff --git a/runtime/syntax/lnkmap.vim b/runtime/syntax/lnkmap.vim
new file mode 100644
index 0000000000..a1d109ef0d
--- /dev/null
+++ b/runtime/syntax/lnkmap.vim
@@ -0,0 +1,35 @@
+" Vim syntax file
+" Language: TI Linker map
+" Document: https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html
+" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>
+" Last Change: 2024 Dec 25
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn match lnkmapTime ">> .*$"
+syn region lnkmapHeadline start="^\*\+$" end="^\*\+$"
+syn match lnkmapHeadline "^[A-Z][-A-Z0-9 ']*\ze\%(:\|$\)"
+syn match lnkmapSectionDelim "^=\+$"
+syn match lnkmapTableDelim "\%(^\|\s\)\zs---*\ze\%($\|\s\)"
+syn match lnkmapNumber "\%(^\|\s\)\zs[0-9a-f]\+\ze\%($\|\s\)"
+syn match lnkmapSections '\<\.\k\+\>'
+syn match lnkmapFile '[^ =]\+\%(\.\S\+\)\+\>'
+syn match lnkmapLibFile '[^ =]\+\.lib\>'
+syn match lnkmapAttrib '\<[RWIX]\+\>'
+syn match lnkmapAttrib '\s\zs--HOLE--\ze\%\(\s\|$\)'
+syn keyword lnkmapAttrib UNINITIALIZED
+
+
+hi def link lnkmapTime Comment
+hi def link lnkmapHeadline Title
+hi def link lnkmapSectionDelim PreProc
+hi def link lnkmapTableDelim PreProc
+hi def link lnkmapNumber Number
+hi def link lnkmapSections Macro
+hi def link lnkmapFile String
+hi def link lnkmapLibFile Special
+hi def link lnkmapAttrib Type
+
+let b:current_syntax = "lnkmap"