annotate runtime/syntax/m4.vim @ 16726:fbab59a5ee6b v8.1.1365

patch 8.1.1365: source command doesn't check for the sandbox commit https://github.com/vim/vim/commit/53575521406739cf20bbe4e384d88e7dca11f040 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 22 22:38:25 2019 +0200 patch 8.1.1365: source command doesn't check for the sandbox Problem: Source command doesn't check for the sandbox. (Armin Razmjou) Solution: Check for the sandbox when sourcing a file.
author Bram Moolenaar <Bram@vim.org>
date Wed, 22 May 2019 22:45:05 +0200
parents 46763b01cd9a
children c58baa6d6dda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: M4
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
3 " Maintainer: Claudio Fleiner (claudio@fleiner.com)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://www.fleiner.com/vim/syntax/m4.vim
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
5 " Last Change: 2005 Jan 15
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " This file will highlight user function calls if they use only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " capital letters and have at least one argument (i.e. the '('
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " must be there). Let me know if this is a problem.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 632
diff changeset
11 " quit when a syntax file was already loaded
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if !exists("main_syntax")
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 632
diff changeset
13 if exists("b:current_syntax")
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 632
diff changeset
14 finish
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 632
diff changeset
15 endif
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 632
diff changeset
16 " we define it here so that included files can test for it
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 let main_syntax='m4'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " define the m4 syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match m4Variable contained "\$\d\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match m4Special contained "$[@*#]"
632
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
23 syn match m4Comment "\<\(m4_\)\=dnl\>.*" contains=SpellErrors
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
24 syn match m4Constants "\<\(m4_\)\=__file__"
b6632d553df3 updated for version 7.0182
vimboss
parents: 7
diff changeset
25 syn match m4Constants "\<\(m4_\)\=__line__"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword m4Constants divnum sysval m4_divnum m4_sysval
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn region m4Paren matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn region m4Command matchgroup=m4Function start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn region m4Command matchgroup=m4Preproc start="\<\(m4_\)\=\(include\|sinclude\)("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn region m4Command matchgroup=m4builtin start="\<\(m4_\)\=\(len\|index\|regexp\|substr\|translit\|patsubst\|format\|incr\|decr\|eval\|maketemp\)("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword m4Statement divert undivert
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn region m4String start="`" end="'" contained contains=@m4Top,@m4StringContents,SpellErrors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 632
diff changeset
39 " 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
40 hi def link m4Delimiter Delimiter
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
41 hi def link m4Comment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
42 hi def link m4Function Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
43 hi def link m4Keyword Keyword
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
44 hi def link m4Special Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
45 hi def link m4String String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
46 hi def link m4Statement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
47 hi def link m4Preproc PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
48 hi def link m4Type Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
49 hi def link m4Special Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
50 hi def link m4Variable Special
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
51 hi def link m4Constants Constant
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
52 hi def link m4Builtin Statement
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 let b:current_syntax = "m4"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 if main_syntax == 'm4'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 " vim: ts=4