Mercurial > vim
annotate runtime/syntax/csc.vim @ 32367:d5e673b941cd v9.0.1515
patch 9.0.1515: reverse() does not work for a String
Commit: https://github.com/vim/vim/commit/03ff1c2dde7f15eca5c9baa6dafbda9b49bedc3b
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sat May 6 14:08:21 2023 +0100
patch 9.0.1515: reverse() does not work for a String
Problem: reverse() does not work for a String.
Solution: Implement reverse() for a String. (Yegappan Lakshmanan,
closes #12179)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 May 2023 15:15:04 +0200 |
parents | 11b656e74444 |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Essbase script | |
3 " Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net> | |
3237 | 4 " Last change: 2011 Dec 25 by Thilo Six |
7 | 5 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
6 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
3237 | 11 let s:cpo_save = &cpo |
12 set cpo&vim | |
13 | |
7 | 14 " folds: fix/endfix and comments |
15 sy region EssFold start="\<Fix" end="EndFix" transparent fold | |
16 | |
17 sy keyword cscTodo contained TODO FIXME XXX | |
18 | |
19 " cscCommentGroup allows adding matches for special things in comments | |
20 sy cluster cscCommentGroup contains=cscTodo | |
21 | |
22 " Strings in quotes | |
23 sy match cscError '"' | |
24 sy match cscString '"[^"]*"' | |
25 | |
26 "when wanted, highlight trailing white space | |
27 if exists("csc_space_errors") | |
28 if !exists("csc_no_trail_space_error") | |
29 sy match cscSpaceE "\s\+$" | |
30 endif | |
31 if !exists("csc_no_tab_space_error") | |
32 sy match cscSpaceE " \+\t"me=e-1 | |
33 endif | |
34 endif | |
35 | |
36 "catch errors caused by wrong parenthesis and brackets | |
37 sy cluster cscParenGroup contains=cscParenE,@cscCommentGroup,cscUserCont,cscBitField,cscFormat,cscNumber,cscFloat,cscOctal,cscNumbers,cscIfError,cscComW,cscCom,cscFormula,cscBPMacro | |
38 sy region cscParen transparent start='(' end=')' contains=ALLBUT,@cscParenGroup | |
39 sy match cscParenE ")" | |
40 | |
41 "integer number, or floating point number without a dot and with "f". | |
42 sy case ignore | |
43 sy match cscNumbers transparent "\<\d\|\.\d" contains=cscNumber,cscFloat,cscOctal | |
44 sy match cscNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" | |
45 "hex number | |
46 sy match cscNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" | |
47 " Flag the first zero of an octal number as something special | |
48 sy match cscOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" | |
49 sy match cscFloat contained "\d\+f" | |
50 "floating point number, with dot, optional exponent | |
51 sy match cscFloat contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" | |
52 "floating point number, starting with a dot, optional exponent | |
53 sy match cscFloat contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" | |
54 "floating point number, without dot, with exponent | |
55 sy match cscFloat contained "\d\+e[-+]\=\d\+[fl]\=\>" | |
56 | |
57 sy region cscComment start="/\*" end="\*/" contains=@cscCommentGroup,cscSpaceE fold | |
58 sy match cscCommentE "\*/" | |
59 | |
60 sy keyword cscIfError IF ELSE ENDIF ELSEIF | |
61 sy keyword cscCondition contained IF ELSE ENDIF ELSEIF | |
62 sy keyword cscFunction contained VARPER VAR UDA TRUNCATE SYD SUMRANGE SUM | |
63 sy keyword cscFunction contained STDDEVRANGE STDDEV SPARENTVAL SLN SIBLINGS SHIFT | |
64 sy keyword cscFunction contained SANCESTVAL RSIBLINGS ROUND REMAINDER RELATIVE PTD | |
65 sy keyword cscFunction contained PRIOR POWER PARENTVAL NPV NEXT MOD MINRANGE MIN | |
66 sy keyword cscFunction contained MDSHIFT MDPARENTVAL MDANCESTVAL MAXRANGE MAX MATCH | |
67 sy keyword cscFunction contained LSIBLINGS LEVMBRS LEV | |
68 sy keyword cscFunction contained ISUDA ISSIBLING ISSAMELEV ISSAMEGEN ISPARENT ISMBR | |
69 sy keyword cscFunction contained ISLEV ISISIBLING ISIPARENT ISIDESC ISICHILD ISIBLINGS | |
70 sy keyword cscFunction contained ISIANCEST ISGEN ISDESC ISCHILD ISANCEST ISACCTYPE | |
71 sy keyword cscFunction contained IRSIBLINGS IRR INTEREST INT ILSIBLINGS IDESCENDANTS | |
72 sy keyword cscFunction contained ICHILDREN IANCESTORS IALLANCESTORS | |
73 sy keyword cscFunction contained GROWTH GENMBRS GEN FACTORIAL DISCOUNT DESCENDANTS | |
74 sy keyword cscFunction contained DECLINE CHILDREN CURRMBRRANGE CURLEV CURGEN | |
75 sy keyword cscFunction contained COMPOUNDGROWTH COMPOUND AVGRANGE AVG ANCESTVAL | |
76 sy keyword cscFunction contained ANCESTORS ALLANCESTORS ACCUM ABS | |
77 sy keyword cscFunction contained @VARPER @VAR @UDA @TRUNCATE @SYD @SUMRANGE @SUM | |
78 sy keyword cscFunction contained @STDDEVRANGE @STDDEV @SPARENTVAL @SLN @SIBLINGS @SHIFT | |
79 sy keyword cscFunction contained @SANCESTVAL @RSIBLINGS @ROUND @REMAINDER @RELATIVE @PTD | |
80 sy keyword cscFunction contained @PRIOR @POWER @PARENTVAL @NPV @NEXT @MOD @MINRANGE @MIN | |
81 sy keyword cscFunction contained @MDSHIFT @MDPARENTVAL @MDANCESTVAL @MAXRANGE @MAX @MATCH | |
82 sy keyword cscFunction contained @LSIBLINGS @LEVMBRS @LEV | |
83 sy keyword cscFunction contained @ISUDA @ISSIBLING @ISSAMELEV @ISSAMEGEN @ISPARENT @ISMBR | |
84 sy keyword cscFunction contained @ISLEV @ISISIBLING @ISIPARENT @ISIDESC @ISICHILD @ISIBLINGS | |
85 sy keyword cscFunction contained @ISIANCEST @ISGEN @ISDESC @ISCHILD @ISANCEST @ISACCTYPE | |
86 sy keyword cscFunction contained @IRSIBLINGS @IRR @INTEREST @INT @ILSIBLINGS @IDESCENDANTS | |
87 sy keyword cscFunction contained @ICHILDREN @IANCESTORS @IALLANCESTORS | |
88 sy keyword cscFunction contained @GROWTH @GENMBRS @GEN @FACTORIAL @DISCOUNT @DESCENDANTS | |
89 sy keyword cscFunction contained @DECLINE @CHILDREN @CURRMBRRANGE @CURLEV @CURGEN | |
90 sy keyword cscFunction contained @COMPOUNDGROWTH @COMPOUND @AVGRANGE @AVG @ANCESTVAL | |
91 sy keyword cscFunction contained @ANCESTORS @ALLANCESTORS @ACCUM @ABS | |
92 sy match cscFunction contained "@" | |
93 sy match cscError "@\s*\a*" contains=cscFunction | |
94 | |
95 sy match cscStatement "&" | |
96 sy keyword cscStatement AGG ARRAY VAR CCONV CLEARDATA DATACOPY | |
97 | |
98 sy match cscComE contained "^\s*CALC.*" | |
99 sy match cscComE contained "^\s*CLEARBLOCK.*" | |
100 sy match cscComE contained "^\s*SET.*" | |
101 sy match cscComE contained "^\s*FIX" | |
102 sy match cscComE contained "^\s*ENDFIX" | |
103 sy match cscComE contained "^\s*ENDLOOP" | |
104 sy match cscComE contained "^\s*LOOP" | |
105 " sy keyword cscCom FIX ENDFIX LOOP ENDLOOP | |
106 | |
107 sy match cscComW "^\s*CALC.*" | |
108 sy match cscCom "^\s*CALC\s*ALL" | |
109 sy match cscCom "^\s*CALC\s*AVERAGE" | |
110 sy match cscCom "^\s*CALC\s*DIM" | |
111 sy match cscCom "^\s*CALC\s*FIRST" | |
112 sy match cscCom "^\s*CALC\s*LAST" | |
113 sy match cscCom "^\s*CALC\s*TWOPASS" | |
114 | |
115 sy match cscComW "^\s*CLEARBLOCK.*" | |
116 sy match cscCom "^\s*CLEARBLOCK\s\+ALL" | |
117 sy match cscCom "^\s*CLEARBLOCK\s\+UPPER" | |
118 sy match cscCom "^\s*CLEARBLOCK\s\+NONINPUT" | |
119 | |
120 sy match cscComW "^\s*\<SET.*" | |
121 sy match cscCom "^\s*\<SET\s\+Commands" | |
122 sy match cscCom "^\s*\<SET\s\+AGGMISSG" | |
123 sy match cscCom "^\s*\<SET\s\+CACHE" | |
124 sy match cscCom "^\s*\<SET\s\+CALCHASHTBL" | |
125 sy match cscCom "^\s*\<SET\s\+CLEARUPDATESTATUS" | |
126 sy match cscCom "^\s*\<SET\s\+FRMLBOTTOMUP" | |
127 sy match cscCom "^\s*\<SET\s\+LOCKBLOCK" | |
128 sy match cscCom "^\s*\<SET\s\+MSG" | |
129 sy match cscCom "^\s*\<SET\s\+NOTICE" | |
130 sy match cscCom "^\s*\<SET\s\+UPDATECALC" | |
131 sy match cscCom "^\s*\<SET\s\+UPTOLOCAL" | |
132 | |
133 sy keyword cscBPMacro contained !LoopOnAll !LoopOnLevel !LoopOnSelected | |
134 sy keyword cscBPMacro contained !CurrentMember !LoopOnDimensions !CurrentDimension | |
135 sy keyword cscBPMacro contained !CurrentOtherLoopDimension !LoopOnOtherLoopDimensions | |
136 sy keyword cscBPMacro contained !EndLoop !AllMembers !SelectedMembers !If !Else !EndIf | |
137 sy keyword cscBPMacro contained LoopOnAll LoopOnLevel LoopOnSelected | |
138 sy keyword cscBPMacro contained CurrentMember LoopOnDimensions CurrentDimension | |
139 sy keyword cscBPMacro contained CurrentOtherLoopDimension LoopOnOtherLoopDimensions | |
140 sy keyword cscBPMacro contained EndLoop AllMembers SelectedMembers If Else EndIf | |
141 sy match cscBPMacro contained "!" | |
142 sy match cscBPW "!\s*\a*" contains=cscBPmacro | |
143 | |
25773 | 144 " when wanted, highlighting lhs members or errors in assignments (may lag the editing) |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
145 if exists("csc_asignment") |
7 | 146 sy match cscEqError '\("[^"]*"\s*\|[^][\t !%()*+,--/:;<=>{}~]\+\s*\|->\s*\)*=\([^=]\@=\|$\)' |
147 sy region cscFormula transparent matchgroup=cscVarName start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\s*=\([^=]\@=\|\n\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition | |
148 sy region cscFormulaIn matchgroup=cscVarName transparent start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\(->\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\)*\s*=\([^=]\@=\|$\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition contained | |
149 sy match cscEq "==" | |
150 endif | |
151 | |
152 if !exists("csc_minlines") | |
153 let csc_minlines = 50 " mostly for () constructs | |
154 endif | |
155 exec "sy sync ccomment cscComment minlines=" . csc_minlines | |
156 | |
157 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
158 " Only when an item doesn't have highlighting yet |
7 | 159 |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3237
diff
changeset
|
160 hi cscVarName term=bold ctermfg=9 gui=bold guifg=blue |
7 | 161 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
162 hi def link cscNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
163 hi def link cscOctal Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
164 hi def link cscFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
165 hi def link cscParenE Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
166 hi def link cscCommentE Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
167 hi def link cscSpaceE Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
168 hi def link cscError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
169 hi def link cscString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
170 hi def link cscComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
171 hi def link cscTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
172 hi def link cscStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
173 hi def link cscIfError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
174 hi def link cscEqError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
175 hi def link cscFunction Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
176 hi def link cscCondition Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
177 hi def link cscWarn WarningMsg |
7 | 178 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
179 hi def link cscComE Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
180 hi def link cscCom Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
181 hi def link cscComW WarningMsg |
7 | 182 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
183 hi def link cscBPMacro Identifier |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
184 hi def link cscBPW WarningMsg |
7 | 185 |
186 | |
187 let b:current_syntax = "csc" | |
188 | |
3237 | 189 let &cpo = s:cpo_save |
190 unlet s:cpo_save | |
7 | 191 " vim: ts=8 |