Mercurial > vim
annotate runtime/syntax/abap.vim @ 27437:37dca3b3f63b
Added tag v8.2.4246 for changeset 4c683d6c0a9d5d8986e364885e4ea1362d34c4de
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 28 Jan 2022 22:15:04 +0100 |
parents | e2e2cc5d0856 |
children | d6dde6229b36 |
rev | line source |
---|---|
22 | 1 " Vim ABAP syntax file |
828 | 2 " Language: SAP - ABAP/R4 |
3893 | 3 " Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com> |
23573 | 4 " Last Change: 2021 Jan 02 |
3893 | 5 " Comment: Thanks to EPI-USE Labs for all your assistance. :) |
22 | 6 |
15194 | 7 " Quit when a syntax file was already loaded |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4911
diff
changeset
|
8 if exists("b:current_syntax") |
22 | 9 finish |
10 endif | |
11 | |
12 " Always ignore case | |
13 syn case ignore | |
14 | |
3920 | 15 " Symbol Operators (space delimited) |
3893 | 16 syn match abapSymbolOperator "\W+\W" |
17 syn match abapSymbolOperator "\W-\W" | |
18 syn match abapSymbolOperator "\W/\W" | |
19 syn match abapSymbolOperator "\W%\W" | |
20 syn match abapSymbolOperator "\W=\W" | |
21 syn match abapSymbolOperator "\W<\W" | |
22 syn match abapSymbolOperator "\W>\W" | |
23 syn match abapSymbolOperator "\W\*\W" | |
24 syn match abapSymbolOperator "\W[<>]=\W" | |
25 syn match abapSymbolOperator "\W<>\W" | |
26 syn match abapSymbolOperator "\W\*\*\W" | |
27 syn match abapSymbolOperator "\[\]" | |
28 syn match abapSymbolOperator "->\*\?" | |
29 syn match abapSymbolOperator "=>" | |
30 syn match abapSymbolOperator "[()~:,\.&$]" | |
22 | 31 |
32 " Literals | |
3893 | 33 syn region abapCharString matchgroup=abapCharString start="'" end="'" contains=abapCharStringEscape |
34 syn match abapCharStringEscape contained "''" | |
22 | 35 |
3893 | 36 syn region abapString matchgroup=abapString start="`" end="`" contains=abapStringEscape |
37 syn match abapStringEscape contained "``" | |
38 | |
39 syn match abapNumber "\-\=\<\d\+\>" | |
22 | 40 syn region abapHex matchgroup=abapHex start="X'" end="'" |
41 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4911
diff
changeset
|
42 setlocal iskeyword=48-57,_,A-Z,a-z,/ |
22 | 43 |
3920 | 44 syn match abapNamespace "\</\w\+/" |
3893 | 45 |
46 " multi-word statements | |
3920 | 47 syn match abapComplexStatement "\<\(WITH\W\+\(HEADER\W\+LINE\|FRAME\|KEY\)\|WITH\)\>" |
48 syn match abapComplexStatement "\<NO\W\+STANDARD\W\+PAGE\W\+HEADING\>" | |
49 syn match abapComplexStatement "\<\(EXIT\W\+FROM\W\+STEP\W\+LOOP\|EXIT\)\>" | |
50 syn match abapComplexStatement "\<\(BEGIN\W\+OF\W\+\(BLOCK\|LINE\)\|BEGIN\W\+OF\)\>" | |
51 syn match abapComplexStatement "\<\(END\W\+OF\W\+\(BLOCK\|LINE\)\|END\W\+OF\)\>" | |
52 syn match abapComplexStatement "\<NO\W\+INTERVALS\>" | |
53 syn match abapComplexStatement "\<RESPECTING\W\+BLANKS\>" | |
54 syn match abapComplexStatement "\<SEPARATED\W\+BY\>" | |
55 syn match abapComplexStatement "\<USING\(\W\+EDIT\W\+MASK\)\?\>" | |
56 syn match abapComplexStatement "\<WHERE\(\W\+LINE\)\?\>" | |
15194 | 57 syn match abapComplexStatement "\<GET\W\+\(TIME\(\W\+STAMP\)\?\(\W\+FIELD\)\?\|PF-STATUS\|BADI\|BIT\|CONNECTION\|CURSOR\|REFERENCE\W\+OF\)\>" |
3920 | 58 syn match abapComplexStatement "\<RADIOBUTTON\W\+GROUP\>" |
59 syn match abapComplexStatement "\<REF\W\+TO\>" | |
60 syn match abapComplexStatement "\<\(PUBLIC\|PRIVATE\|PROTECTED\)\(\W\+SECTION\)\?\>" | |
61 syn match abapComplexStatement "\<DELETING\W\+\(TRAILING\|LEADING\)\>" | |
62 syn match abapComplexStatement "\<\(ALL\W\+OCCURRENCES\)\|\(\(FIRST\|LAST\)\W\+OCCURRENCE\)\>" | |
63 syn match abapComplexStatement "\<INHERITING\W\+FROM\>" | |
64 syn match abapComplexStatement "\<\(UP\W\+\)\?TO\>" | |
3893 | 65 |
66 " hyphenated-word statements | |
3920 | 67 syn match abapComplexStatement "\<LINE-COUNT\>" |
68 syn match abapComplexStatement "\<ADD-CORRESPONDING\>" | |
69 syn match abapComplexStatement "\<AUTHORITY-CHECK\>" | |
70 syn match abapComplexStatement "\<BREAK-POINT\>" | |
71 syn match abapComplexStatement "\<CLASS-DATA\>" | |
72 syn match abapComplexStatement "\<CLASS-METHODS\>" | |
73 syn match abapComplexStatement "\<CLASS-METHOD\>" | |
74 syn match abapComplexStatement "\<DIVIDE-CORRESPONDING\>" | |
75 syn match abapComplexStatement "\<EDITOR-CALL\>" | |
76 syn match abapComplexStatement "\<END-OF-DEFINITION\>" | |
77 syn match abapComplexStatement "\<END-OF-PAGE\>" | |
78 syn match abapComplexStatement "\<END-OF-SELECTION\>" | |
79 syn match abapComplexStatement "\<FIELD-GROUPS\>" | |
80 syn match abapComplexStatement "\<FIELD-SYMBOLS\>" | |
81 syn match abapComplexStatement "\<FUNCTION-POOL\>" | |
82 syn match abapComplexStatement "\<IS\W\+\(NOT\W\+\)\?\(ASSIGNED\|BOUND\|INITIAL\|SUPPLIED\)\>" | |
83 syn match abapComplexStatement "\<MOVE-CORRESPONDING\>" | |
84 syn match abapComplexStatement "\<MULTIPLY-CORRESPONDING\>" | |
85 syn match abapComplexStatement "\<NEW-LINE\>" | |
86 syn match abapComplexStatement "\<NEW-PAGE\>" | |
87 syn match abapComplexStatement "\<NEW-SECTION\>" | |
88 syn match abapComplexStatement "\<PRINT-CONTROL\>" | |
89 syn match abapComplexStatement "\<RP-PROVIDE-FROM-LAST\>" | |
90 syn match abapComplexStatement "\<SELECT-OPTIONS\>" | |
91 syn match abapComplexStatement "\<SELECTION-SCREEN\>" | |
92 syn match abapComplexStatement "\<START-OF-SELECTION\>" | |
93 syn match abapComplexStatement "\<SUBTRACT-CORRESPONDING\>" | |
94 syn match abapComplexStatement "\<SYNTAX-CHECK\>" | |
95 syn match abapComplexStatement "\<SYNTAX-TRACE\>" | |
96 syn match abapComplexStatement "\<TOP-OF-PAGE\>" | |
97 syn match abapComplexStatement "\<TYPE-POOL\>" | |
98 syn match abapComplexStatement "\<TYPE-POOLS\>" | |
99 syn match abapComplexStatement "\<LINE-SIZE\>" | |
100 syn match abapComplexStatement "\<LINE-COUNT\>" | |
101 syn match abapComplexStatement "\<MESSAGE-ID\>" | |
102 syn match abapComplexStatement "\<DISPLAY-MODE\>" | |
103 syn match abapComplexStatement "\<READ\(-ONLY\)\?\>" | |
3893 | 104 |
22 | 105 " ABAP statements |
3893 | 106 syn keyword abapStatement ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT |
3920 | 107 syn keyword abapStatement BACK |
3893 | 108 syn keyword abapStatement CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY |
109 syn keyword abapStatement DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO | |
110 syn keyword abapStatement ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT | |
111 syn keyword abapStatement FETCH FIELDS FORM FORMAT FREE FROM FUNCTION | |
15194 | 112 syn keyword abapStatement GENERATE |
22 | 113 syn keyword abapStatement HIDE |
3920 | 114 syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION |
3893 | 115 syn keyword abapStatement LEAVE LIKE LINE LOAD LOCAL LOOP |
116 syn keyword abapStatement MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY | |
117 syn keyword abapStatement ON OVERLAY OPTIONAL OTHERS | |
118 syn keyword abapStatement PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT | |
3920 | 119 syn keyword abapStatement RAISE RANGES RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK |
3893 | 120 syn keyword abapStatement SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS |
121 syn keyword abapStatement TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES | |
122 syn keyword abapStatement UNASSIGN ULINE UNPACK UPDATE | |
22 | 123 syn keyword abapStatement WHEN WHILE WINDOW WRITE |
124 | |
125 " More statemets | |
3920 | 126 syn keyword abapStatement LINES |
127 syn keyword abapStatement INTO GROUP BY HAVING ORDER BY SINGLE | |
128 syn keyword abapStatement APPENDING CORRESPONDING FIELDS OF TABLE | |
129 syn keyword abapStatement LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER ROWS CONNECTING | |
22 | 130 syn keyword abapStatement OCCURS STRUCTURE OBJECT PROPERTY |
131 syn keyword abapStatement CASTING APPEND RAISING VALUE COLOR | |
3893 | 132 syn keyword abapStatement CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT |
133 syn keyword abapStatement ID NUMBER FOR TITLE OUTPUT | |
22 | 134 |
135 " Special ABAP specific tables: | |
4911 | 136 syn match abapSpecialTables "\<\(sy\|\(hrp\|p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)-"me=e-1 contained |
3920 | 137 syn match abapStructure "\<\w\+-[^\>]"me=e-2 contains=abapSpecialTables,abapStatement,abapComplexStatement |
138 syn match abapField "-\w\+"ms=s+1 | |
22 | 139 |
140 " Pointer | |
141 syn match abapSpecial "<\w\+>" | |
142 | |
3920 | 143 " Abap common constants: |
22 | 144 syn keyword abapSpecial TRUE FALSE NULL SPACE |
145 | |
146 " Includes | |
147 syn region abapInclude start="include" end="." contains=abapComment | |
148 | |
149 " Types | |
15194 | 150 syn keyword abapTypes c n i int8 p f d t x string xstring decfloat16 decfloat34 |
22 | 151 |
152 " Atritmitic operators | |
153 syn keyword abapOperator abs sign ceil floor trunc frac acos asin atan cos sin tan | |
154 syn keyword abapOperator cosh sinh tanh exp log log10 sqrt | |
155 | |
156 " String operators | |
3920 | 157 syn keyword abapStatement strlen xstrlen charlen numofchar dbmaxlen |
22 | 158 |
159 syn keyword abapOperator EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN | |
160 | |
161 " An error? Not strictly... but cannot think of reason this is intended. | |
162 syn match abapError "\.\." | |
163 | |
164 " Comments | |
165 syn region abapComment start="^\*" end="$" contains=abapTodo | |
166 syn match abapComment "\".*" contains=abapTodo | |
828 | 167 syn keyword abapTodo contained TODO NOTE |
3893 | 168 syn match abapTodo "\#EC\W\+\w\+" |
22 | 169 |
170 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4911
diff
changeset
|
171 " Only when an item doesn't have highlighting yet |
22 | 172 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
173 hi def link abapError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
174 hi def link abapComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
175 hi def link abapInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
176 hi def link abapStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
177 hi def link abapComplexStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
178 hi def link abapSpecial Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
179 hi def link abapNamespace Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
180 hi def link abapSpecialTables Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
181 hi def link abapSymbolOperator abapOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
182 hi def link abapOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
183 hi def link abapCharString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
184 hi def link abapString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
185 hi def link abapFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
186 hi def link abapTypes Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
187 hi def link abapSymbol Structure |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
188 hi def link abapStructure Structure |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
189 hi def link abapField Variable |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
190 hi def link abapNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
191 hi def link abapHex Number |
22 | 192 |
193 | |
194 let b:current_syntax = "abap" | |
195 | |
23573 | 196 " vim: ts=8 sw=2 |