blob: 203f9f05e0efe44fc7e08086ba474cbc5505af41 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file:
2" Language: Clipper 5.2 & FlagShip
3" Maintainer: C R Zamana <zamana@zip.net>
4" Some things based on c.vim by Bram Moolenaar and pascal.vim by Mario Eusebio
Bram Moolenaarb6b046b2011-12-30 13:11:27 +01005" Last Change: 2011 Dec 29 by Thilo Six
Bram Moolenaar071d4272004-06-13 20:20:40 +00006
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02007" quit when a syntax file was already loaded
8if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 finish
10endif
11
Bram Moolenaarb6b046b2011-12-30 13:11:27 +010012let s:cpo_save = &cpo
13set cpo&vim
14
Bram Moolenaar071d4272004-06-13 20:20:40 +000015" Exceptions for my "Very Own" (TM) user variables naming style.
16" If you don't like this, comment it
17syn 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 ignore
22
23" Clipper keywords ( in no particular order )
24syn keyword clipperStatement ACCEPT APPEND BLANK FROM AVERAGE CALL CANCEL
25syn keyword clipperStatement CLEAR ALL GETS MEMORY TYPEAHEAD CLOSE
26syn keyword clipperStatement COMMIT CONTINUE SHARED NEW PICT
27syn keyword clipperStatement COPY FILE STRUCTURE STRU EXTE TO COUNT
28syn keyword clipperStatement CREATE FROM NIL
29syn keyword clipperStatement DELETE FILE DIR DISPLAY EJECT ERASE FIND GO
30syn keyword clipperStatement INDEX INPUT VALID WHEN
31syn keyword clipperStatement JOIN KEYBOARD LABEL FORM LIST LOCATE MENU TO
32syn keyword clipperStatement NOTE PACK QUIT READ
33syn keyword clipperStatement RECALL REINDEX RELEASE RENAME REPLACE REPORT
34syn keyword clipperStatement RETURN FORM RESTORE
35syn keyword clipperStatement RUN SAVE SEEK SELECT
36syn keyword clipperStatement SKIP SORT STORE SUM TEXT TOTAL TYPE UNLOCK
37syn keyword clipperStatement UPDATE USE WAIT ZAP
38syn keyword clipperStatement BEGIN SEQUENCE
39syn keyword clipperStatement SET ALTERNATE BELL CENTURY COLOR CONFIRM CONSOLE
40syn keyword clipperStatement CURSOR DATE DECIMALS DEFAULT DELETED DELIMITERS
41syn keyword clipperStatement DEVICE EPOCH ESCAPE EXACT EXCLUSIVE FILTER FIXED
42syn keyword clipperStatement FORMAT FUNCTION INTENSITY KEY MARGIN MESSAGE
43syn keyword clipperStatement ORDER PATH PRINTER PROCEDURE RELATION SCOREBOARD
44syn keyword clipperStatement SOFTSEEK TYPEAHEAD UNIQUE WRAP
45syn keyword clipperStatement BOX CLEAR GET PROMPT SAY ? ??
46syn keyword clipperStatement DELETE TAG GO RTLINKCMD TMP DBLOCKINFO
47syn keyword clipperStatement DBEVALINFO DBFIELDINFO DBFILTERINFO DBFUNCTABLE
48syn keyword clipperStatement DBOPENINFO DBORDERCONDINFO DBORDERCREATEINF
49syn keyword clipperStatement DBORDERINFO DBRELINFO DBSCOPEINFO DBSORTINFO
50syn keyword clipperStatement DBSORTITEM DBTRANSINFO DBTRANSITEM WORKAREA
51
52" Conditionals
53syn keyword clipperConditional CASE OTHERWISE ENDCASE
54syn keyword clipperConditional IF ELSE ENDIF IIF IFDEF IFNDEF
55
56" Loops
57syn keyword clipperRepeat DO WHILE ENDDO
58syn keyword clipperRepeat FOR TO NEXT STEP
59
60" Visibility
61syn keyword clipperStorageClass ANNOUNCE STATIC
62syn keyword clipperStorageClass DECLARE EXTERNAL LOCAL MEMVAR PARAMETERS
63syn keyword clipperStorageClass PRIVATE PROCEDURE PUBLIC REQUEST STATIC
64syn keyword clipperStorageClass FIELD FUNCTION
65syn keyword clipperStorageClass EXIT PROCEDURE INIT PROCEDURE
66
67" Operators
68syn match clipperOperator "$\|%\|&\|+\|-\|->\|!"
69syn match clipperOperator "\.AND\.\|\.NOT\.\|\.OR\."
70syn match clipperOperator ":=\|<\|<=\|<>\|!=\|#\|=\|==\|>\|>=\|@"
71syn match clipperOperator "*"
72
73" Numbers
74syn match clipperNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
75
76" Includes
77syn region clipperIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
78syn match clipperIncluded contained "<[^>]*>"
79syn match clipperInclude "^\s*#\s*include\>\s*["<]" contains=clipperIncluded
80
81" String and Character constants
82syn region clipperString start=+"+ end=+"+
83syn region clipperString start=+'+ end=+'+
84
85" Delimiters
86syn match ClipperDelimiters "[()]\|[\[\]]\|[{}]\|[||]"
87
88" Special
89syn 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, which
96 " also ends on "*/", and sees a "*" at the start of the line as comment
97 " 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=clipperCommentSkip
100 syntax region clipperComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$"
101 syntax region clipperComment start="/\*" end="\*/" contains=clipperCommentString,clipperCharacter,clipperNumber,clipperString
102 syntax match clipperComment "//.*" contains=clipperComment2String,clipperCharacter,clipperNumber
103else
104 syn region clipperComment start="/\*" end="\*/"
105 syn match clipperComment "//.*"
106endif
107syntax match clipperCommentError "\*/"
108
109" Lines beggining with an "*" are comments too
110syntax match clipperComment "^\*.*"
111
112
113" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200114" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200116hi def link clipperConditional Conditional
117hi def link clipperRepeat Repeat
118hi def link clipperNumber Number
119hi def link clipperInclude Include
120hi def link clipperComment Comment
121hi def link clipperOperator Operator
122hi def link clipperStorageClass StorageClass
123hi def link clipperStatement Statement
124hi def link clipperString String
125hi def link clipperFunction Function
126hi def link clipperLineContinuation Special
127hi def link clipperDelimiters Delimiter
128hi def link clipperUserVariable Identifier
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129
Bram Moolenaar071d4272004-06-13 20:20:40 +0000130
131let b:current_syntax = "clipper"
132
Bram Moolenaarb6b046b2011-12-30 13:11:27 +0100133let &cpo = s:cpo_save
134unlet s:cpo_save
135" vim: ts=8