Mercurial > vim
annotate runtime/syntax/m4.vim @ 31531:6e24001000ed v9.0.1098
patch 9.0.1098: code uses too much indent
Commit: https://github.com/vim/vim/commit/465de3a57b815f1188c707e7c083950c81652536
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Dec 26 12:50:04 2022 +0000
patch 9.0.1098: code uses too much indent
Problem: Code uses too much indent.
Solution: Use an early return. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/11747)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 26 Dec 2022 14:00:07 +0100 |
parents | 2a1f9b4a5ac9 |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: M4 | |
632 | 3 " Maintainer: Claudio Fleiner (claudio@fleiner.com) |
7 | 4 " URL: http://www.fleiner.com/vim/syntax/m4.vim |
29121 | 5 " (outdated) |
6 " Last Change: 2022 Jun 12 | |
7 | 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. | |
11 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
12 " quit when a syntax file was already loaded |
7 | 13 if !exists("main_syntax") |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
14 if exists("b:current_syntax") |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
15 finish |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
16 endif |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
17 " we define it here so that included files can test for it |
7 | 18 let main_syntax='m4' |
19 endif | |
20 | |
21 " define the m4 syntax | |
22 syn match m4Variable contained "\$\d\+" | |
23 syn match m4Special contained "$[@*#]" | |
632 | 24 syn match m4Comment "\<\(m4_\)\=dnl\>.*" contains=SpellErrors |
29104 | 25 syn match m4Comment "#.*" contains=SpellErrors |
632 | 26 syn match m4Constants "\<\(m4_\)\=__file__" |
27 syn match m4Constants "\<\(m4_\)\=__line__" | |
7 | 28 syn keyword m4Constants divnum sysval m4_divnum m4_sysval |
29 syn region m4Paren matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top | |
30 syn region m4Command matchgroup=m4Function start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top | |
31 syn region m4Command matchgroup=m4Preproc start="\<\(m4_\)\=\(include\|sinclude\)("he=e-1 end=")" contains=@m4Top | |
32 syn region m4Command matchgroup=m4Statement start="\<\(m4_\)\=\(syscmd\|esyscmd\|ifdef\|ifelse\|indir\|builtin\|shift\|errprint\|m4exit\|changecom\|changequote\|changeword\|m4wrap\|debugfile\|divert\|undivert\)("he=e-1 end=")" contains=@m4Top | |
33 syn region m4Command matchgroup=m4builtin start="\<\(m4_\)\=\(len\|index\|regexp\|substr\|translit\|patsubst\|format\|incr\|decr\|eval\|maketemp\)("he=e-1 end=")" contains=@m4Top | |
34 syn keyword m4Statement divert undivert | |
35 syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top | |
36 syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top | |
29104 | 37 syn region m4String start="`" end="'" contains=SpellErrors |
7 | 38 syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function |
39 | |
40 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
632
diff
changeset
|
41 " Only when an item doesn't have highlighting yet |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
42 hi def link m4Delimiter Delimiter |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
43 hi def link m4Comment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
44 hi def link m4Function Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
45 hi def link m4Keyword Keyword |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
46 hi def link m4Special Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
47 hi def link m4String String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
48 hi def link m4Statement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
49 hi def link m4Preproc PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
50 hi def link m4Type Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
51 hi def link m4Special Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
52 hi def link m4Variable Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
53 hi def link m4Constants Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
54 hi def link m4Builtin Statement |
7 | 55 |
56 let b:current_syntax = "m4" | |
57 | |
58 if main_syntax == 'm4' | |
59 unlet main_syntax | |
60 endif | |
61 | |
62 " vim: ts=4 |