22
|
1 " Vim ABAP syntax file
|
828
|
2 " Language: SAP - ABAP/R4
|
|
3 " Revision: 1.0
|
|
4 " Maintainer: Marius Piedallu van Wyk <marius@e.co.za>
|
|
5 " Last Change: 2006 Apr 13
|
22
|
6
|
828
|
7 " For version < 6.0: Clear all syntax items
|
|
8 " For version >= 6.0: Quit when a syntax file was already loaded
|
22
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15 " Always ignore case
|
|
16 syn case ignore
|
|
17
|
|
18 " Symbol Operators
|
828
|
19 syn match abapSymbolOperator "[+\-/=<>$]"
|
|
20 syn match abapSymbolOperator "\*"
|
|
21 syn match abapSymbolOperator "[<>]="
|
|
22 syn match abapSymbolOperator "<>"
|
|
23 syn match abapSymbolOperator "\*\*"
|
|
24 syn match abapSymbolOperator "[()]"
|
|
25 syn match abapSymbolOperator "[:,\.]"
|
22
|
26
|
|
27 " Literals
|
|
28 syn region abapString matchgroup=abapString start="'" end="'" contains=abapStringEscape
|
|
29 syn match abapStringEscape contained "''"
|
|
30
|
828
|
31 syn match abapNumber "-\=\<\d\+\>"
|
22
|
32 syn region abapHex matchgroup=abapHex start="X'" end="'"
|
|
33
|
|
34 if version >= 600
|
|
35 setlocal iskeyword=-,48-57,_,A-Z,a-z
|
|
36 else
|
|
37 set iskeyword=-,48-57,_,A-Z,a-z
|
|
38 endif
|
|
39
|
|
40 " ABAP statements
|
|
41 syn keyword abapStatement ADD ADD-CORRESPONDING ASSIGN AT AUTHORITY-CHECK
|
|
42 syn keyword abapStatement BACK BREAK-POINT
|
|
43 syn keyword abapStatement CALL CASE CHECK CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY
|
|
44 syn keyword abapStatement DATA DEFINE DELETE DESCRIBE DETAIL DIVIDE DIVIDE-CORRESPONDING DO
|
|
45 syn keyword abapStatement EDITOR-CALL ELSE ELSEIF END-OF-DEFINITION END-OF-PAGE END-OF-SELECTION ENDAT ENDCASE ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDLOOP ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDWHILE EXEC EXPORT EXPORTING EXTRACT
|
|
46 syn keyword abapStatement FETCH FIELD-GROUPS FIELD-SYMBOLS FIELDS FORM FORMAT FREE FUNCTION FUNCTION-POOL
|
|
47 syn keyword abapStatement GENERATE GET
|
|
48 syn keyword abapStatement HIDE
|
|
49 syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INPUT INSERT
|
|
50 syn keyword abapStatement LEAVE LIKE LOAD LOCAL LOOP
|
|
51 syn keyword abapStatement MESSAGE MODIFY MODULE MOVE MOVE-CORRESPONDING MULTIPLY MULTIPLY-CORRESPONDING
|
|
52 syn keyword abapStatement NEW-LINE NEW-PAGE NEW-SECTION
|
|
53 syn keyword abapStatement ON OVERLAY
|
|
54 syn keyword abapStatement PACK PARAMETERS PERFORM POSITION PRINT-CONTROL PROGRAM PROVIDE PUT
|
828
|
55 syn keyword abapStatement RAISE RANGES READ RECEIVE REFRESH REJECT REPLACE REPORT RESERVE RESTORE ROLLBACK RP-PROVIDE-FROM-LAST
|
22
|
56 syn keyword abapStatement SCAN SCROLL SEARCH SELECT SELECT-OPTIONS SELECTION-SCREEN SET SHIFT SKIP SORT SPLIT START-OF-SELECTION STATICS STOP SUBMIT SUBTRACT SUBTRACT-CORRESPONDING SUM SUMMARY SUPPRESS SYNTAX-CHECK SYNTAX-TRACE
|
|
57 syn keyword abapStatement TABLES TOP-OF-PAGE TRANSFER TRANSLATE TYPE TYPE-POOL TYPE-POOLS TYPES
|
|
58 syn keyword abapStatement UNPACK UPDATE
|
|
59 syn keyword abapStatement WHEN WHILE WINDOW WRITE
|
|
60
|
|
61 " More statemets
|
|
62 syn keyword abapStatement OCCURS STRUCTURE OBJECT PROPERTY
|
|
63 syn keyword abapStatement CASTING APPEND RAISING VALUE COLOR
|
|
64 syn keyword abapStatement LINE-SIZE LINE-COUNT MESSAGE-ID
|
|
65 syn keyword abapStatement CHANGING EXCEPTIONS DEFAULT CHECKBOX COMMENT
|
|
66 syn keyword abapStatement ID NUMBER FOR DISPLAY-MODE TITLE OUTPUT
|
|
67
|
|
68 " More multi-word statements
|
|
69 syn match abapStatement "\(\W\|^\)\(WITH\W\+\(HEADER\W\+LINE\|FRAME\|KEY\)\|WITH\)\(\W\|$\)"ms=s+1,me=e-1
|
|
70 syn match abapStatement "\(\W\|^\)NO\W\+STANDARD\W\+PAGE\W\+HEADING\(\W\|$\)"ms=s+1,me=e-1
|
|
71 syn match abapStatement "\(\W\|^\)\(EXIT\W\+FROM\W\+STEP\W\+LOOP\|EXIT\)\(\W\|$\)"ms=s+1,me=e-1
|
|
72 syn match abapStatement "\(\W\|^\)\(BEGIN\W\+OF\W\+\(BLOCK\|LINE\)\|BEGIN\W\+OF\)\(\W\|$\)"ms=s+1,me=e-1
|
|
73 syn match abapStatement "\(\W\|^\)\(END\W\+OF\W\+\(BLOCK\|LINE\)\|END\W\+OF\)\(\W\|$\)"ms=s+1,me=e-1
|
|
74 syn match abapStatement "\(\W\|^\)IS\W\+INITIAL\(\W\|$\)"ms=s+1,me=e-1
|
|
75 syn match abapStatement "\(\W\|^\)NO\W\+INTERVALS\(\W\|$\)"ms=s+1,me=e-1
|
|
76 syn match abapStatement "\(\W\|^\)SEPARATED\W\+BY\(\W\|$\)"ms=s+1,me=e-1
|
|
77 syn match abapStatement "\(\W\|^\)\(USING\W\+\(EDIT\W\+MASK\)\|USING\)\(\W\|$\)"ms=s+1,me=e-1
|
|
78 syn match abapStatement "\(\W\|^\)\(WHERE\W\+\(LINE\)\)\(\W\|$\)"ms=s+1,me=e-1
|
|
79 syn match abapStatement "\(\W\|^\)RADIOBUTTON\W\+GROUP\(\W\|$\)"ms=s+1,me=e-1
|
|
80 syn match abapStatement "\(\W\|^\)REF\W\+TO\(\W\|$\)"ms=s+1,me=e-1
|
|
81
|
|
82 " Special ABAP specific tables:
|
|
83 syn match abapSpecial "\(\W\|^\)\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)\(\W\|$\)"ms=s+1,me=e-1
|
|
84 syn match abapSpecialTables "\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)-"me=e-1 contained
|
828
|
85 syn match abapSpecial "\(\W\|^\)\w\+-\(\w\+-\w\+\|\w\+\)"ms=s+1 contains=abapSpecialTables
|
22
|
86
|
|
87 " Pointer
|
|
88 syn match abapSpecial "<\w\+>"
|
|
89
|
|
90 " Abap constants:
|
|
91 syn keyword abapSpecial TRUE FALSE NULL SPACE
|
|
92
|
|
93 " Includes
|
|
94 syn region abapInclude start="include" end="." contains=abapComment
|
|
95
|
|
96 " Types
|
|
97 syn keyword abapTypes c n i p f d t x
|
|
98
|
|
99 " Atritmitic operators
|
|
100 syn keyword abapOperator abs sign ceil floor trunc frac acos asin atan cos sin tan
|
|
101 syn keyword abapOperator cosh sinh tanh exp log log10 sqrt
|
|
102
|
|
103 " String operators
|
|
104 syn keyword abapOperator strlen xstrlen charlen numofchar dbmaxlen
|
|
105
|
|
106 " Table operators
|
|
107 syn keyword abapOperator lines
|
|
108
|
|
109 " Table operators (SELECT operators)
|
|
110 syn keyword abapOperator INTO FROM WHERE GROUP BY HAVING ORDER BY SINGLE
|
|
111 syn keyword abapOperator APPENDING CORRESPONDING FIELDS OF TABLE
|
|
112 syn keyword abapOperator LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING
|
|
113 syn keyword abapOperator EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN
|
|
114
|
|
115 " An error? Not strictly... but cannot think of reason this is intended.
|
|
116 syn match abapError "\.\."
|
|
117
|
|
118 " Comments
|
|
119 syn region abapComment start="^\*" end="$" contains=abapTodo
|
|
120 syn match abapComment "\".*" contains=abapTodo
|
828
|
121 syn keyword abapTodo contained TODO NOTE
|
22
|
122
|
|
123 " Define the default highlighting.
|
|
124 " For version 5.7 and earlier: only when not done already
|
|
125 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
126 if version >= 508 || !exists("did_abap_syntax_inits")
|
|
127 if version < 508
|
|
128 let did_abap_syntax_inits = 1
|
|
129 command -nargs=+ HiLink hi link <args>
|
|
130 else
|
|
131 command -nargs=+ HiLink hi def link <args>
|
|
132 endif
|
|
133
|
|
134 HiLink abapError Error
|
828
|
135 HiLink abapComment Comment
|
|
136 HiLink abapInclude Include
|
22
|
137 HiLink abapSpecial Special
|
|
138 HiLink abapSpecialTables PreProc
|
828
|
139 HiLink abapSymbolOperator abapOperator
|
|
140 HiLink abapOperator Operator
|
|
141 HiLink abapStatement Statement
|
|
142 HiLink abapString String
|
|
143 HiLink abapFloat Float
|
|
144 HiLink abapNumber Number
|
|
145 HiLink abapHex Number
|
22
|
146
|
|
147 delcommand HiLink
|
|
148 endif
|
|
149
|
|
150 let b:current_syntax = "abap"
|
|
151
|
|
152 " vim: ts=8 sw=2
|
828
|
153
|