codekingpro/portable-devtools
114k
1" Vim syntax file:2" Language: Clipper 5.2 & FlagShip3" Maintainer: C R Zamana <zamana@zip.net>4" Some things based on c.vim by Bram Moolenaar and pascal.vim by Mario Eusebio5" Last Change: 2011 Dec 29 by Thilo Six6 7" quit when a syntax file was already loaded8if exists("b:current_syntax")9 finish10endif11 12let s:cpo_save = &cpo13set cpo&vim14 15" Exceptions for my "Very Own" (TM) user variables naming style.16" If you don't like this, comment it17syn match clipperUserVariable "\<[a,b,c,d,l,n,o,u,x][A-Z][A-Za-z0-9_]*\>"18syn match clipperUserVariable "\<[a-z]\>"19 20" Clipper is case insensitive ( see "exception" above )21syn case ignore22 23" Clipper keywords ( in no particular order )24syn keyword clipperStatement ACCEPT APPEND BLANK FROM AVERAGE CALL CANCEL25syn keyword clipperStatement CLEAR ALL GETS MEMORY TYPEAHEAD CLOSE26syn keyword clipperStatement COMMIT CONTINUE SHARED NEW PICT27syn keyword clipperStatement COPY FILE STRUCTURE STRU EXTE TO COUNT28syn keyword clipperStatement CREATE FROM NIL29syn keyword clipperStatement DELETE FILE DIR DISPLAY EJECT ERASE FIND GO30syn keyword clipperStatement INDEX INPUT VALID WHEN31syn keyword clipperStatement JOIN KEYBOARD LABEL FORM LIST LOCATE MENU TO32syn keyword clipperStatement NOTE PACK QUIT READ33syn keyword clipperStatement RECALL REINDEX RELEASE RENAME REPLACE REPORT34syn keyword clipperStatement RETURN FORM RESTORE35syn keyword clipperStatement RUN SAVE SEEK SELECT36syn keyword clipperStatement SKIP SORT STORE SUM TEXT TOTAL TYPE UNLOCK37syn keyword clipperStatement UPDATE USE WAIT ZAP38syn keyword clipperStatement BEGIN SEQUENCE39syn keyword clipperStatement SET ALTERNATE BELL CENTURY COLOR CONFIRM CONSOLE40syn keyword clipperStatement CURSOR DATE DECIMALS DEFAULT DELETED DELIMITERS41syn keyword clipperStatement DEVICE EPOCH ESCAPE EXACT EXCLUSIVE FILTER FIXED42syn keyword clipperStatement FORMAT FUNCTION INTENSITY KEY MARGIN MESSAGE43syn keyword clipperStatement ORDER PATH PRINTER PROCEDURE RELATION SCOREBOARD44syn keyword clipperStatement SOFTSEEK TYPEAHEAD UNIQUE WRAP45syn keyword clipperStatement BOX CLEAR GET PROMPT SAY ? ??46syn keyword clipperStatement DELETE TAG GO RTLINKCMD TMP DBLOCKINFO47syn keyword clipperStatement DBEVALINFO DBFIELDINFO DBFILTERINFO DBFUNCTABLE48syn keyword clipperStatement DBOPENINFO DBORDERCONDINFO DBORDERCREATEINF49syn keyword clipperStatement DBORDERINFO DBRELINFO DBSCOPEINFO DBSORTINFO50syn keyword clipperStatement DBSORTITEM DBTRANSINFO DBTRANSITEM WORKAREA51 52" Conditionals53syn keyword clipperConditional CASE OTHERWISE ENDCASE54syn keyword clipperConditional IF ELSE ENDIF IIF IFDEF IFNDEF55 56" Loops57syn keyword clipperRepeat DO WHILE ENDDO58syn keyword clipperRepeat FOR TO NEXT STEP59 60" Visibility61syn keyword clipperStorageClass ANNOUNCE STATIC62syn keyword clipperStorageClass DECLARE EXTERNAL LOCAL MEMVAR PARAMETERS63syn keyword clipperStorageClass PRIVATE PROCEDURE PUBLIC REQUEST STATIC64syn keyword clipperStorageClass FIELD FUNCTION65syn keyword clipperStorageClass EXIT PROCEDURE INIT PROCEDURE66 67" Operators68syn match clipperOperator "$\|%\|&\|+\|-\|->\|!"69syn match clipperOperator "\.AND\.\|\.NOT\.\|\.OR\."70syn match clipperOperator ":=\|<\|<=\|<>\|!=\|#\|=\|==\|>\|>=\|@"71syn match clipperOperator "*"72 73" Numbers74syn match clipperNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"75 76" Includes77syn region clipperIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+78syn match clipperIncluded contained "<[^>]*>"79syn match clipperInclude "^\s*#\s*include\>\s*["<]" contains=clipperIncluded80 81" String and Character constants82syn region clipperString start=+"+ end=+"+83syn region clipperString start=+'+ end=+'+84 85" Delimiters86syn match ClipperDelimiters "[()]\|[\[\]]\|[{}]\|[||]"87 88" Special89syn match clipperLineContinuation ";"90 91" This is from Bram Moolenaar:92if exists("c_comment_strings")93 " A comment can contain cString, cCharacter and cNumber.94 " But a "*/" inside a cString in a clipperComment DOES end the comment!95 " So we need to use a special type of cString: clipperCommentString, which96 " also ends on "*/", and sees a "*" at the start of the line as comment97 " again. Unfortunately this doesn't very well work for // type of comments :-(98 syntax match clipperCommentSkip contained "^\s*\*\($\|\s\+\)"99 syntax region clipperCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=clipperCommentSkip100 syntax region clipperComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$"101 syntax region clipperComment start="/\*" end="\*/" contains=clipperCommentString,clipperCharacter,clipperNumber,clipperString102 syntax match clipperComment "//.*" contains=clipperComment2String,clipperCharacter,clipperNumber103else104 syn region clipperComment start="/\*" end="\*/"105 syn match clipperComment "//.*"106endif107syntax match clipperCommentError "\*/"108 109" Lines beggining with an "*" are comments too110syntax match clipperComment "^\*.*"111 112 113" Define the default highlighting.114" Only when an item doesn't have highlighting yet115 116hi def link clipperConditional Conditional117hi def link clipperRepeat Repeat118hi def link clipperNumber Number119hi def link clipperInclude Include120hi def link clipperComment Comment121hi def link clipperOperator Operator122hi def link clipperStorageClass StorageClass123hi def link clipperStatement Statement124hi def link clipperString String125hi def link clipperFunction Function126hi def link clipperLineContinuation Special127hi def link clipperDelimiters Delimiter128hi def link clipperUserVariable Identifier129 130 131let b:current_syntax = "clipper"132 133let &cpo = s:cpo_save134unlet s:cpo_save135" vim: ts=8136 