annotate runtime/syntax/r.vim @ 31663:2f8a3cde553f v9.0.1164

patch 9.0.1164: evaluating string expression advances function line Commit: https://github.com/vim/vim/commit/01c5f2addf86b8d8940d71c92f6219f14a6df99e Author: h-east <h.east.727@gmail.com> Date: Mon Jan 9 15:10:40 2023 +0000 patch 9.0.1164: evaluating string expression advances function line Problem: Evaluating string expression advances function line. Solution: Disable function lines while parsing a string expression. (Hirohito Higashi, closes #11796)
author Bram Moolenaar <Bram@vim.org>
date Mon, 09 Jan 2023 16:15:03 +0100
parents 5bda4653aced
children b2412874362f
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
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
2 " Language: R (GNU S)
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
3 " Maintainer: Jakson Aquino <jalvesaq@gmail.com>
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
4 " Former Maintainers: Vaidotas Zemlys <zemlys@gmail.com>
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
5 " Tom Payne <tom@tompayne.org>
7315
444efa5f5015 commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
6 " Contributor: Johannes Ranke <jranke@uni-bremen.de>
444efa5f5015 commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
7 " Homepage: https://github.com/jalvesaq/R-Vim-runtime
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
8 " Last Change: Sun Mar 28, 2021 01:47PM
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
9 " Filenames: *.R *.r *.Rhistory *.Rt
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
10 "
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
11 " NOTE: The highlighting of R functions might be defined in
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
12 " runtime files created by a filetype plugin, if installed.
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
13 "
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
14 " CONFIGURATION:
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
15 " Syntax folding can be turned on by
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
16 "
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
17 " let r_syntax_folding = 1
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
18 "
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
19 " ROxygen highlighting can be turned off by
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
20 "
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
21 " let r_syntax_hl_roxygen = 0
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
22 "
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
23 " Some lines of code were borrowed from Zhuojun Chen.
625
81fe2ccc1207 updated for version 7.0179
vimboss
parents: 7
diff changeset
24
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
25 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
29 if has("patch-7.4.1142")
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
30 syn iskeyword @,48-57,_,.
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
31 else
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
32 setlocal iskeyword=@,48-57,_,.
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
33 endif
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
34
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
35 " The variables g:r_hl_roxygen and g:r_syn_minlines were renamed on April 8, 2017.
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
36 if exists("g:r_hl_roxygen")
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
37 let g:r_syntax_hl_roxygen = g:r_hl_roxygen
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
38 endif
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
39 if exists("g:r_syn_minlines")
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
40 let g:r_syntax_minlines = g:r_syn_minlines
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
41 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
43 if exists("g:r_syntax_folding") && g:r_syntax_folding
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
44 setlocal foldmethod=syntax
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
45 endif
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
46
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
47 let g:r_syntax_hl_roxygen = get(g:, 'r_syntax_hl_roxygen', 1)
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
48
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Comment
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
52 syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
53 syn match rTodoParen contained "\(BUG\|FIXME\|NOTE\|TODO\)\s*(.\{-})\s*:" contains=rTodoKeyw,rTodoInfo transparent
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
54 syn keyword rTodoKeyw BUG FIXME NOTE TODO contained
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
55 syn match rTodoInfo "(\zs.\{-}\ze)" contained
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
56 syn match rComment contains=@Spell,rCommentTodo,rTodoParen "#.*"
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
57
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
58 " Roxygen
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
59 if g:r_syntax_hl_roxygen
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
60 " A roxygen block can start at the beginning of a file (first version) and
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
61 " after a blank line (second version). It ends when a line appears that does not
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
62 " contain a roxygen comment. In the following comments, any line containing
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
63 " a roxygen comment marker (one or two hash signs # followed by a single
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
64 " quote ' and preceded only by whitespace) is called a roxygen line. A
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
65 " roxygen line containing only a roxygen comment marker, optionally followed
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
66 " by whitespace is called an empty roxygen line.
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
67
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
68 " First we match all roxygen blocks as containing only a title. In case an
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
69 " empty roxygen line ending the title or a tag is found, this will be
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
70 " overridden later by the definitions of rOBlock.
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
71 syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
72 syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
73
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
74 " A title as part of a block is always at the beginning of the block, i.e.
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
75 " either at the start of a file or after a completely empty line.
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
76 syn match rOTitle "\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
77 syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
78 syn match rOTitleTag contained "@title"
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
79
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
80 " When a roxygen block has a title and additional content, the title
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
81 " consists of one or more roxygen lines (as little as possible are matched),
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
82 " followed either by an empty roxygen line
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
83 syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
84 syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
7315
444efa5f5015 commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
85
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
86 " or by a roxygen tag (we match everything starting with @ but not @@ which is used as escape sequence for a literal @).
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
87 syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
88 syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
89
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
90 " If a block contains an @rdname, @describeIn tag, it may have paragraph breaks, but does not have a title
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
91 syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
92 syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
93 syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
94 syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
95
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
96 syn match rOCommentKey "^\s*#\{1,2}'" contained
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
97 syn region rOExamples start="^\s*#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
98
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
99 " R6 classes may contain roxygen lines independent of roxygen blocks
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
100 syn region rOR6Class start=/R6Class(/ end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
101 syn match rOR6Block "#\{1,2}'.*" contains=rOTag,rOExamples,@Spell containedin=rOR6Class contained
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
102 syn match rOR6Block "^\s*#\{1,2}'.*" contains=rOTag,rOExamples,@Spell containedin=rOR6Class contained
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
103
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
104 " rOTag list originally generated from the lists that were available in
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
105 " https://github.com/klutometis/roxygen/R/rd.R and
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
106 " https://github.com/klutometis/roxygen/R/namespace.R
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
107 " using s/^ \([A-Za-z0-9]*\) = .*/ syn match rOTag contained "@\1"/
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
108 " Plus we need the @include tag
7315
444efa5f5015 commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
109
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
110 " rd.R
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
111 syn match rOTag contained "@aliases"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
112 syn match rOTag contained "@author"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
113 syn match rOTag contained "@backref"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
114 syn match rOTag contained "@concept"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
115 syn match rOTag contained "@describeIn"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
116 syn match rOTag contained "@description"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
117 syn match rOTag contained "@details"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
118 syn match rOTag contained "@docType"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
119 syn match rOTag contained "@encoding"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
120 syn match rOTag contained "@evalRd"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
121 syn match rOTag contained "@example"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
122 syn match rOTag contained "@examples"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
123 syn match rOTag contained "@family"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
124 syn match rOTag contained "@field"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
125 syn match rOTag contained "@format"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
126 syn match rOTag contained "@inherit"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
127 syn match rOTag contained "@inheritParams"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
128 syn match rOTag contained "@inheritDotParams"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
129 syn match rOTag contained "@inheritSection"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
130 syn match rOTag contained "@keywords"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
131 syn match rOTag contained "@method"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
132 syn match rOTag contained "@name"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
133 syn match rOTag contained "@md"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
134 syn match rOTag contained "@noMd"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
135 syn match rOTag contained "@noRd"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
136 syn match rOTag contained "@note"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
137 syn match rOTag contained "@param"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
138 syn match rOTag contained "@rdname"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
139 syn match rOTag contained "@rawRd"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
140 syn match rOTag contained "@references"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
141 syn match rOTag contained "@return"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
142 syn match rOTag contained "@section"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
143 syn match rOTag contained "@seealso"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
144 syn match rOTag contained "@slot"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
145 syn match rOTag contained "@source"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
146 syn match rOTag contained "@template"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
147 syn match rOTag contained "@templateVar"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
148 syn match rOTag contained "@title"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
149 syn match rOTag contained "@usage"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
150 " namespace.R
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
151 syn match rOTag contained "@export"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
152 syn match rOTag contained "@exportClass"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
153 syn match rOTag contained "@exportMethod"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
154 syn match rOTag contained "@exportPattern"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
155 syn match rOTag contained "@import"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
156 syn match rOTag contained "@importClassesFrom"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
157 syn match rOTag contained "@importFrom"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
158 syn match rOTag contained "@importMethodsFrom"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
159 syn match rOTag contained "@rawNamespace"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
160 syn match rOTag contained "@S3method"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
161 syn match rOTag contained "@useDynLib"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
162 " other
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
163 syn match rOTag contained "@eval"
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
164 syn match rOTag contained "@include"
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
165 syn match rOTag contained "@includeRmd"
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
166 syn match rOTag contained "@order"
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
167 endif
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
168
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
170 if &filetype == "rhelp"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
171 " string enclosed in double quotes
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
172 syn region rString contains=rSpecial,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
173 " string enclosed in single quotes
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
174 syn region rString contains=rSpecial,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
175 else
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
176 " string enclosed in double quotes
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
177 syn region rString contains=rSpecial,rStrError,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
178 " string enclosed in single quotes
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
179 syn region rString contains=rSpecial,rStrError,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
180 endif
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
181
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
182 syn match rStrError display contained "\\."
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
183
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
184
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
185 " New line, carriage return, tab, backspace, bell, feed, vertical tab, backslash
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
186 syn match rSpecial display contained "\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
188 " Hexadecimal and Octal digits
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
189 syn match rSpecial display contained "\\\(x\x\{1,2}\|[0-8]\{1,3}\)"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
190
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
191 " Unicode characters
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
192 syn match rSpecial display contained "\\u\x\{1,4}"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
193 syn match rSpecial display contained "\\U\x\{1,8}"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
194 syn match rSpecial display contained "\\u{\x\{1,4}}"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
195 syn match rSpecial display contained "\\U{\x\{1,8}}"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
196
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
197 " Raw string
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
198 syn region rRawString matchgroup=rRawStrDelim start=/[rR]\z(['"]\)\z(-*\)(/ end=/)\z2\z1/ keepend
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
199 syn region rRawString matchgroup=rRawStrDelim start=/[rR]\z(['"]\)\z(-*\){/ end=/}\z2\z1/ keepend
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
200 syn region rRawString matchgroup=rRawStrDelim start=/[rR]\z(['"]\)\z(-*\)\[/ end=/\]\z2\z1/ keepend
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
201
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 " Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 syn keyword rStatement break next return
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 syn keyword rConditional if else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 syn keyword rRepeat for in repeat while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
207 " Constant (not really)
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
208 syn keyword rConstant T F LETTERS letters month.abb month.name pi
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
209 syn keyword rConstant R.version.string
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
210
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
211 syn keyword rNumber NA_integer_ NA_real_ NA_complex_ NA_character_
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
212
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
213 " Constants
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 syn keyword rConstant NULL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 syn keyword rBoolean FALSE TRUE
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
216 syn keyword rNumber NA Inf NaN
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
217
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
218 " integer
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
219 syn match rInteger "\<\d\+L"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
220 syn match rInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
221 syn match rInteger "\<\d\+[Ee]+\=\d\+L"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
222
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
223 " number with no fractional part or exponent
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
224 syn match rNumber "\<\d\+\>"
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
225 " hexadecimal number
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
226 syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
227
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
228 " floating point number with integer and fractional parts and optional exponent
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
229 syn match rFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\="
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
230 " floating point number with no integer part and optional exponent
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
231 syn match rFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\="
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
232 " floating point number with no fractional part and optional exponent
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
233 syn match rFloat "\<\d\+[Ee][-+]\=\d\+"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
234
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
235 " complex number
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
236 syn match rComplex "\<\d\+i"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
237 syn match rComplex "\<\d\++\d\+i"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
238 syn match rComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
239 syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
240 syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
241 syn match rComplex "\<\d\+[Ee][-+]\=\d\+i"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
242
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
243 syn match rAssign '='
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
244 syn match rOperator "&"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
245 syn match rOperator '-'
4502
605c9ce57ec3 Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2725
diff changeset
246 syn match rOperator '\*'
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
247 syn match rOperator '+'
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
248 if &filetype != "rmd" && &filetype != "rrst"
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
249 syn match rOperator "[|!<>^~/:]"
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
250 else
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
251 syn match rOperator "[|!<>^~`/:]"
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
252 endif
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
253 syn match rOperator "%\{2}\|%\S\{-}%"
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
254 syn match rOperator '\([!><]\)\@<=='
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
255 syn match rOperator '=='
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
256 syn match rOpError '\*\{3}'
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
257 syn match rOpError '//'
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
258 syn match rOpError '&&&'
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
259 syn match rOpError '|||'
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
260 syn match rOpError '<<'
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
261 syn match rOpError '>>'
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
262
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
263 syn match rAssign "<\{1,2}-"
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
264 syn match rAssign "->\{1,2}"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 " Special
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
267 syn match rDelimiter "[,;:]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 " Error
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
270 if exists("g:r_syntax_folding")
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
271 syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
272 syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError fold
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
273 syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError fold
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
274 syn region rSection matchgroup=Title start=/^#.*[-=#]\{4,}/ end=/^#.*[-=#]\{4,}/ms=s-2,me=s-1 transparent contains=ALL fold
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
275 else
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
276 syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
277 syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
278 syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
279 endif
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
280
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
281 syn match rError "[)\]}]"
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
282 syn match rBraceError "[)}]" contained
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
283 syn match rCurlyError "[)\]]" contained
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
284 syn match rParenError "[\]}]" contained
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
285
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
286 " Use Nvim-R to highlight functions dynamically if it is installed
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
287 if !exists("g:r_syntax_fun_pattern")
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
288 let s:ff = split(substitute(globpath(&rtp, "R/functions.vim"), "functions.vim", "", "g"), "\n")
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
289 if len(s:ff) > 0
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
290 let g:r_syntax_fun_pattern = 0
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
291 else
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
292 let g:r_syntax_fun_pattern = 1
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
293 endif
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
294 endif
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
295
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
296 " Only use Nvim-R to highlight functions if they should not be highlighted
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
297 " according to a generic pattern
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
298 if g:r_syntax_fun_pattern == 1
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
299 syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze('
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
300 else
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
301 " Nvim-R:
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
302 runtime R/functions.vim
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
303 endif
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
304
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
305 syn match rDollar display contained "\$"
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
306 syn match rDollar display contained "@"
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
307
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
308 " List elements will not be highlighted as functions:
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
309 syn match rLstElmt "\$[a-zA-Z0-9\\._]*" contains=rDollar
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
310 syn match rLstElmt "@[a-zA-Z0-9\\._]*" contains=rDollar
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
311
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
312 " Functions that may add new objects
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
313 syn keyword rPreProc library require attach detach source
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
314
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
315 if &filetype == "rhelp"
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
316 syn match rHelpIdent '\\method'
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
317 syn match rHelpIdent '\\S4method'
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
318 endif
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
319
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
320 " Type
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
321 syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
323 " Name of object with spaces
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
324 if &filetype != "rmd" && &filetype != "rrst"
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
325 syn region rNameWSpace start="`" end="`" contains=rSpaceFun
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4502
diff changeset
326 endif
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
327
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
328 if &filetype == "rhelp"
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
329 syn match rhPreProc "^#ifdef.*"
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
330 syn match rhPreProc "^#endif.*"
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
331 syn match rhSection "\\dontrun\>"
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
332 endif
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
333
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
334 if exists("r_syntax_minlines")
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
335 exe "syn sync minlines=" . r_syntax_minlines
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
336 else
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
337 syn sync minlines=40
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
338 endif
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
339
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 " Define the default highlighting.
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
341 hi def link rAssign Statement
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
342 hi def link rBoolean Boolean
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
343 hi def link rBraceError Error
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
344 hi def link rComment Comment
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
345 hi def link rTodoParen Comment
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
346 hi def link rTodoInfo SpecialComment
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
347 hi def link rCommentTodo Todo
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
348 hi def link rTodoKeyw Todo
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
349 hi def link rComplex Number
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
350 hi def link rConditional Conditional
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
351 hi def link rConstant Constant
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
352 hi def link rCurlyError Error
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
353 hi def link rDelimiter Delimiter
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
354 hi def link rDollar SpecialChar
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
355 hi def link rError Error
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
356 hi def link rFloat Float
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
357 hi def link rFunction Function
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 11347
diff changeset
358 hi def link rSpaceFun Function
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
359 hi def link rHelpIdent Identifier
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
360 hi def link rhPreProc PreProc
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
361 hi def link rhSection PreCondit
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
362 hi def link rInteger Number
6476
11d78e58a487 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
363 hi def link rLstElmt Normal
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
364 hi def link rNameWSpace Normal
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
365 hi def link rNumber Number
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
366 hi def link rOperator Operator
2725
6f63330ec225 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2608
diff changeset
367 hi def link rOpError Error
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
368 hi def link rParenError Error
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
369 hi def link rPreProc PreProc
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
370 hi def link rRawString String
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
371 hi def link rRawStrDelim Delimiter
2608
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
372 hi def link rRepeat Repeat
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
373 hi def link rSpecial SpecialChar
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
374 hi def link rStatement Statement
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
375 hi def link rString String
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
376 hi def link rStrError Error
7d8af31066c8 Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 856
diff changeset
377 hi def link rType Type
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
378 if g:r_syntax_hl_roxygen
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
379 hi def link rOTitleTag Operator
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
380 hi def link rOTag Operator
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
381 hi def link rOTitleBlock Title
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
382 hi def link rOBlock Comment
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
383 hi def link rOBlockNoTitle Comment
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
384 hi def link rOR6Block Comment
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
385 hi def link rOTitle Title
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
386 hi def link rOCommentKey Comment
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
387 hi def link rOExamples SpecialComment
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7315
diff changeset
388 endif
7315
444efa5f5015 commit https://github.com/vim/vim/commit/2c5e8e80eacf491d4f266983f534a77776c7ae83
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
389
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 let b:current_syntax="r"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 " vim: ts=8 sw=2