Mercurial > vim
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 |
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 |
632 | 5 " Last Change: 2005 Jan 15 |
7 | 6 |
7 " This file will highlight user function calls if they use only | |
8 " capital letters and have at least one argument (i.e. the '(' | |
9 " must be there). Let me know if this is a problem. | |
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 | 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 | 17 let main_syntax='m4' |
18 endif | |
19 | |
20 " define the m4 syntax | |
21 syn match m4Variable contained "\$\d\+" | |
22 syn match m4Special contained "$[@*#]" | |
632 | 23 syn match m4Comment "\<\(m4_\)\=dnl\>.*" contains=SpellErrors |
24 syn match m4Constants "\<\(m4_\)\=__file__" | |
25 syn match m4Constants "\<\(m4_\)\=__line__" | |
7 | 26 syn keyword m4Constants divnum sysval m4_divnum m4_sysval |
27 syn region m4Paren matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top | |
28 syn region m4Command matchgroup=m4Function start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top | |
29 syn region m4Command matchgroup=m4Preproc start="\<\(m4_\)\=\(include\|sinclude\)("he=e-1 end=")" contains=@m4Top | |
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 | |
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 | |
32 syn keyword m4Statement divert undivert | |
33 syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top | |
34 syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top | |
35 syn region m4String start="`" end="'" contained contains=@m4Top,@m4StringContents,SpellErrors | |
36 syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function | |
37 | |
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 | 53 |
54 let b:current_syntax = "m4" | |
55 | |
56 if main_syntax == 'm4' | |
57 unlet main_syntax | |
58 endif | |
59 | |
60 " vim: ts=4 |