0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00
vim/runtime/syntax/abap.vim

214 lines
8.9 KiB
VimL
Raw Normal View History

2004-09-02 19:12:26 +00:00
" Vim ABAP syntax file
2006-04-13 20:37:35 +00:00
" Language: SAP - ABAP/R4
2012-10-21 03:02:54 +02:00
" Revision: 2.0
" Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
" Last Change: 2012 Oct 12
" Comment: Thanks to EPI-USE Labs for all your assistance. :)
2004-09-02 19:12:26 +00:00
2006-04-13 20:37:35 +00:00
" For version < 6.0: Clear all syntax items
" For version >= 6.0: Quit when a syntax file was already loaded
2004-09-02 19:12:26 +00:00
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Always ignore case
syn case ignore
" Symbol Operators
2012-10-21 03:02:54 +02:00
syn match abapSymbolOperator "\W+\W"
syn match abapSymbolOperator "\W-\W"
syn match abapSymbolOperator "\W/\W"
syn match abapSymbolOperator "\W%\W"
syn match abapSymbolOperator "\W=\W"
syn match abapSymbolOperator "\W<\W"
syn match abapSymbolOperator "\W>\W"
syn match abapSymbolOperator "\W\*\W"
syn match abapSymbolOperator "\W[<>]=\W"
syn match abapSymbolOperator "\W<>\W"
syn match abapSymbolOperator "\W\*\*\W"
syn match abapSymbolOperator "\[\]"
syn match abapSymbolOperator "->\*\?"
syn match abapSymbolOperator "=>"
syn match abapSymbolOperator "[()~:,\.&$]"
2004-09-02 19:12:26 +00:00
" Literals
2012-10-21 03:02:54 +02:00
syn region abapCharString matchgroup=abapCharString start="'" end="'" contains=abapCharStringEscape
syn match abapCharStringEscape contained "''"
2004-09-02 19:12:26 +00:00
2012-10-21 03:02:54 +02:00
syn region abapString matchgroup=abapString start="`" end="`" contains=abapStringEscape
syn match abapStringEscape contained "``"
syn match abapNumber "\-\=\<\d\+\>"
2004-09-02 19:12:26 +00:00
syn region abapHex matchgroup=abapHex start="X'" end="'"
if version >= 600
2012-10-21 03:02:54 +02:00
setlocal iskeyword=48-57,_,A-Z,a-z,/
2004-09-02 19:12:26 +00:00
else
2012-10-21 03:02:54 +02:00
set iskeyword=48-57,_,A-Z,a-z,/
2004-09-02 19:12:26 +00:00
endif
2012-10-21 03:02:54 +02:00
syn match abapNamespace "/\w\+/"
" multi-word statements
syn match abapComplexStatement "\(WITH\W\+\(HEADER\W\+LINE\|FRAME\|KEY\)\|WITH\)"
syn match abapComplexStatement "NO\W\+STANDARD\W\+PAGE\W\+HEADING"
syn match abapComplexStatement "\(EXIT\W\+FROM\W\+STEP\W\+LOOP\|EXIT\)"
syn match abapComplexStatement "\(BEGIN\W\+OF\W\+\(BLOCK\|LINE\)\|BEGIN\W\+OF\)"
syn match abapComplexStatement "\(END\W\+OF\W\+\(BLOCK\|LINE\)\|END\W\+OF\)"
syn match abapComplexStatement "NO\W\+INTERVALS"
syn match abapComplexStatement "RESPECTING\W\+BLANKS"
syn match abapComplexStatement "SEPARATED\W\+BY"
syn match abapComplexStatement "\(USING\W\+\(EDIT\W\+MASK\)\|USING\)"
syn match abapComplexStatement "\(WHERE\W\+\(LINE\)\)"
syn match abapComplexStatement "RADIOBUTTON\W\+GROUP"
syn match abapComplexStatement "REF\W\+TO"
syn match abapComplexStatement "\(PUBLIC\|PRIVATE\|PROTECTED\)\(\W\+SECTION\)\?"
syn match abapComplexStatement "DELETING\W\+\(TRAILING\|LEADING\)"
syn match abapComplexStatement "\(ALL\W\+OCCURRENCES\)\|\(\(FIRST\|LAST\)\W\+OCCURRENCE\)"
syn match abapComplexStatement "INHERITING\W\+FROM"
" hyphenated-word statements
syn match abapComplexStatement "LINE-COUNT"
syn match abapComplexStatement "ADD-CORRESPONDING"
syn match abapComplexStatement "AUTHORITY-CHECK"
syn match abapComplexStatement "BREAK-POINT"
syn match abapComplexStatement "CLASS-DATA"
syn match abapComplexStatement "CLASS-METHODS"
syn match abapComplexStatement "CLASS-METHOD"
syn match abapComplexStatement "DIVIDE-CORRESPONDING"
syn match abapComplexStatement "EDITOR-CALL"
syn match abapComplexStatement "END-OF-DEFINITION"
syn match abapComplexStatement "END-OF-PAGE"
syn match abapComplexStatement "END-OF-SELECTION"
syn match abapComplexStatement "FIELD-GROUPS"
syn match abapComplexStatement "FIELD-SYMBOLS"
syn match abapComplexStatement "FUNCTION-POOL"
syn match abapComplexStatement "MOVE-CORRESPONDING"
syn match abapComplexStatement "MULTIPLY-CORRESPONDING"
syn match abapComplexStatement "NEW-LINE"
syn match abapComplexStatement "NEW-PAGE"
syn match abapComplexStatement "NEW-SECTION"
syn match abapComplexStatement "PRINT-CONTROL"
syn match abapComplexStatement "RP-PROVIDE-FROM-LAST"
syn match abapComplexStatement "SELECT-OPTIONS"
syn match abapComplexStatement "SELECTION-SCREEN"
syn match abapComplexStatement "START-OF-SELECTION"
syn match abapComplexStatement "SUBTRACT-CORRESPONDING"
syn match abapComplexStatement "SYNTAX-CHECK"
syn match abapComplexStatement "SYNTAX-TRACE"
syn match abapComplexStatement "TOP-OF-PAGE"
syn match abapComplexStatement "TYPE-POOL"
syn match abapComplexStatement "TYPE-POOLS"
syn match abapComplexStatement "LINE-SIZE"
syn match abapComplexStatement "LINE-COUNT"
syn match abapComplexStatement "MESSAGE-ID"
syn match abapComplexStatement "DISPLAY-MODE"
syn match abapComplexStatement "READ\(-ONLY\)\?"
2004-09-02 19:12:26 +00:00
" ABAP statements
2012-10-21 03:02:54 +02:00
syn keyword abapStatement ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT
syn keyword abapStatement BACK BOUND
syn keyword abapStatement CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY
syn keyword abapStatement DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO
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
syn keyword abapStatement FETCH FIELDS FORM FORMAT FREE FROM FUNCTION
2004-09-02 19:12:26 +00:00
syn keyword abapStatement GENERATE GET
syn keyword abapStatement HIDE
2012-10-21 03:02:54 +02:00
syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIAL INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION IS
syn keyword abapStatement LEAVE LIKE LINE LOAD LOCAL LOOP
syn keyword abapStatement MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY
syn keyword abapStatement ON OVERLAY OPTIONAL OTHERS
syn keyword abapStatement PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT
syn keyword abapStatement RAISE RANGES RECEIVE REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK
syn keyword abapStatement SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS
syn keyword abapStatement TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES
syn keyword abapStatement UNASSIGN ULINE UNPACK UPDATE
2004-09-02 19:12:26 +00:00
syn keyword abapStatement WHEN WHILE WINDOW WRITE
" More statemets
syn keyword abapStatement OCCURS STRUCTURE OBJECT PROPERTY
syn keyword abapStatement CASTING APPEND RAISING VALUE COLOR
2012-10-21 03:02:54 +02:00
syn keyword abapStatement CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT
syn keyword abapStatement ID NUMBER FOR TITLE OUTPUT
2004-09-02 19:12:26 +00:00
" Special ABAP specific tables:
syn match abapSpecial "\(\W\|^\)\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapSpecialTables "\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)-"me=e-1 contained
2012-10-21 03:02:54 +02:00
syn match abapSpecial "\(\W\|^\)\w\+-\(\w\+-\w\+\|\w\+\)"ms=s+1 contains=abapSpecialTables,abapStatement,abapComplexStatement
2004-09-02 19:12:26 +00:00
" Pointer
syn match abapSpecial "<\w\+>"
" Abap constants:
syn keyword abapSpecial TRUE FALSE NULL SPACE
" Includes
syn region abapInclude start="include" end="." contains=abapComment
" Types
2012-10-21 03:02:54 +02:00
syn keyword abapTypes c n i p f d t x string xstring decfloat16 decfloat34
2004-09-02 19:12:26 +00:00
" Atritmitic operators
syn keyword abapOperator abs sign ceil floor trunc frac acos asin atan cos sin tan
syn keyword abapOperator cosh sinh tanh exp log log10 sqrt
" String operators
syn keyword abapOperator strlen xstrlen charlen numofchar dbmaxlen
" Table operators
syn keyword abapOperator lines
" Table operators (SELECT operators)
2012-10-21 03:02:54 +02:00
syn keyword abapOperator INTO WHERE GROUP BY HAVING ORDER BY SINGLE
2004-09-02 19:12:26 +00:00
syn keyword abapOperator APPENDING CORRESPONDING FIELDS OF TABLE
syn keyword abapOperator LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING
syn keyword abapOperator EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN
" An error? Not strictly... but cannot think of reason this is intended.
syn match abapError "\.\."
" Comments
syn region abapComment start="^\*" end="$" contains=abapTodo
syn match abapComment "\".*" contains=abapTodo
2006-04-13 20:37:35 +00:00
syn keyword abapTodo contained TODO NOTE
2012-10-21 03:02:54 +02:00
syn match abapTodo "\#EC\W\+\w\+"
2004-09-02 19:12:26 +00:00
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_abap_syntax_inits")
if version < 508
let did_abap_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink abapError Error
2006-04-13 20:37:35 +00:00
HiLink abapComment Comment
HiLink abapInclude Include
2012-10-21 03:02:54 +02:00
HiLink abapStatement Statement
HiLink abapComplexStatement Statement
2004-09-02 19:12:26 +00:00
HiLink abapSpecial Special
2012-10-21 03:02:54 +02:00
HiLink abapNamespace Special
2004-09-02 19:12:26 +00:00
HiLink abapSpecialTables PreProc
2006-04-13 20:37:35 +00:00
HiLink abapSymbolOperator abapOperator
HiLink abapOperator Operator
2012-10-21 03:02:54 +02:00
HiLink abapCharString String
2006-04-13 20:37:35 +00:00
HiLink abapString String
HiLink abapFloat Float
2012-10-21 03:02:54 +02:00
HiLink abapTypes Type
HiLink abapSymbol Structure
2006-04-13 20:37:35 +00:00
HiLink abapNumber Number
HiLink abapHex Number
2004-09-02 19:12:26 +00:00
delcommand HiLink
endif
let b:current_syntax = "abap"
" vim: ts=8 sw=2
2006-04-13 20:37:35 +00:00