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