Skip to content

Commit 3eacfbe

Browse files
zeertzjqdlejay
authored andcommitted
vim-patch:efb913a: runtime(m4): Remove m4Function
closes: vim/vim#18211 vim/vim@efb913a Co-authored-by: Damien Lejay <[email protected]>
1 parent 32dbb05 commit 3eacfbe

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

runtime/syntax/m4.vim

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
" Last Change: 2022 Jun 12
55
" 2025 Sep 2 by Vim project: fix a few syntax issues #18192
66
" 2025 Sep 5 by Vim project: introduce m4Disabled region #18200
7-
8-
" This file will highlight user function calls if they use only
9-
" capital letters and have at least one argument (i.e. the '('
10-
" must be there). Let me know if this is a problem.
7+
" 2025 Sep 6 by Vim project: remove m4Function heuristics #18211
118

129
" quit when a syntax file was already loaded
1310
if !exists("main_syntax")
@@ -45,6 +42,13 @@ syn region m4Quoted
4542
" – Comments themselves are disabled when quoted.
4643
syn region m4Disabled start=+#+ end=+$+ containedin=ALLBUT,m4Quoted
4744

45+
" Macros in M4:
46+
" – Name tokens consist of the longest possible sequence of letters, digits,
47+
" and underscores, where the first character is not a digit.
48+
" – In GNU M4, this can be altered with changeword().
49+
" – Any name token may be defined as a macro and quoting prevents expansion.
50+
" Thus correct highlighting requires running M4.
51+
4852
" define the m4 syntax
4953
syn match m4Variable contained "\$\d\+"
5054
syn match m4Special contained "$[@*#]"
@@ -59,15 +63,13 @@ syn region m4Command matchgroup=m4Statement start="\<\(m4_\)\=\(syscmd\|esyscmd
5963
syn region m4Command matchgroup=m4Builtin start="\<\(m4_\)\=\(len\|index\|regexp\|substr\|translit\|patsubst\|format\|incr\|decr\|eval\|maketemp\)("he=e-1 end=")" contains=@m4Top
6064
syn keyword m4Statement divert undivert
6165
syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top
62-
syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top
63-
syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4Paren,m4Command,m4Statement,m4Function,m4Quoted
66+
syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4Paren,m4Command,m4Statement,m4Quoted
6467

6568
" Define the default highlighting.
6669
" Only when an item doesn't have highlighting yet
6770
hi def link m4QuoteDelim Delimiter
6871
hi def link m4Delimiter Delimiter
6972
hi def link m4Comment Comment
70-
hi def link m4Function Function
7173
hi def link m4Keyword Keyword
7274
hi def link m4Special Special
7375
hi def link m4Statement Statement

0 commit comments

Comments
 (0)