7
|
1 " 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
|
3237
|
5 " Last Change: 2011 Dec 29 by Thilo Six
|
7
|
6
|
|
7 " For version 5.x: Clear all syntax items
|
|
8 " For version 6.x: Quit when a syntax file was already loaded
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
3237
|
15 let s:cpo_save = &cpo
|
|
16 set cpo&vim
|
|
17
|
7
|
18 " Exceptions for my "Very Own" (TM) user variables naming style.
|
|
19 " If you don't like this, comment it
|
|
20 syn match clipperUserVariable "\<[a,b,c,d,l,n,o,u,x][A-Z][A-Za-z0-9_]*\>"
|
|
21 syn match clipperUserVariable "\<[a-z]\>"
|
|
22
|
|
23 " Clipper is case insensitive ( see "exception" above )
|
|
24 syn case ignore
|
|
25
|
|
26 " Clipper keywords ( in no particular order )
|
|
27 syn keyword clipperStatement ACCEPT APPEND BLANK FROM AVERAGE CALL CANCEL
|
|
28 syn keyword clipperStatement CLEAR ALL GETS MEMORY TYPEAHEAD CLOSE
|
|
29 syn keyword clipperStatement COMMIT CONTINUE SHARED NEW PICT
|
|
30 syn keyword clipperStatement COPY FILE STRUCTURE STRU EXTE TO COUNT
|
|
31 syn keyword clipperStatement CREATE FROM NIL
|
|
32 syn keyword clipperStatement DELETE FILE DIR DISPLAY EJECT ERASE FIND GO
|
|
33 syn keyword clipperStatement INDEX INPUT VALID WHEN
|
|
34 syn keyword clipperStatement JOIN KEYBOARD LABEL FORM LIST LOCATE MENU TO
|
|
35 syn keyword clipperStatement NOTE PACK QUIT READ
|
|
36 syn keyword clipperStatement RECALL REINDEX RELEASE RENAME REPLACE REPORT
|
|
37 syn keyword clipperStatement RETURN FORM RESTORE
|
|
38 syn keyword clipperStatement RUN SAVE SEEK SELECT
|
|
39 syn keyword clipperStatement SKIP SORT STORE SUM TEXT TOTAL TYPE UNLOCK
|
|
40 syn keyword clipperStatement UPDATE USE WAIT ZAP
|
|
41 syn keyword clipperStatement BEGIN SEQUENCE
|
|
42 syn keyword clipperStatement SET ALTERNATE BELL CENTURY COLOR CONFIRM CONSOLE
|
|
43 syn keyword clipperStatement CURSOR DATE DECIMALS DEFAULT DELETED DELIMITERS
|
|
44 syn keyword clipperStatement DEVICE EPOCH ESCAPE EXACT EXCLUSIVE FILTER FIXED
|
|
45 syn keyword clipperStatement FORMAT FUNCTION INTENSITY KEY MARGIN MESSAGE
|
|
46 syn keyword clipperStatement ORDER PATH PRINTER PROCEDURE RELATION SCOREBOARD
|
|
47 syn keyword clipperStatement SOFTSEEK TYPEAHEAD UNIQUE WRAP
|
|
48 syn keyword clipperStatement BOX CLEAR GET PROMPT SAY ? ??
|
|
49 syn keyword clipperStatement DELETE TAG GO RTLINKCMD TMP DBLOCKINFO
|
|
50 syn keyword clipperStatement DBEVALINFO DBFIELDINFO DBFILTERINFO DBFUNCTABLE
|
|
51 syn keyword clipperStatement DBOPENINFO DBORDERCONDINFO DBORDERCREATEINF
|
|
52 syn keyword clipperStatement DBORDERINFO DBRELINFO DBSCOPEINFO DBSORTINFO
|
|
53 syn keyword clipperStatement DBSORTITEM DBTRANSINFO DBTRANSITEM WORKAREA
|
|
54
|
|
55 " Conditionals
|
|
56 syn keyword clipperConditional CASE OTHERWISE ENDCASE
|
|
57 syn keyword clipperConditional IF ELSE ENDIF IIF IFDEF IFNDEF
|
|
58
|
|
59 " Loops
|
|
60 syn keyword clipperRepeat DO WHILE ENDDO
|
|
61 syn keyword clipperRepeat FOR TO NEXT STEP
|
|
62
|
|
63 " Visibility
|
|
64 syn keyword clipperStorageClass ANNOUNCE STATIC
|
|
65 syn keyword clipperStorageClass DECLARE EXTERNAL LOCAL MEMVAR PARAMETERS
|
|
66 syn keyword clipperStorageClass PRIVATE PROCEDURE PUBLIC REQUEST STATIC
|
|
67 syn keyword clipperStorageClass FIELD FUNCTION
|
|
68 syn keyword clipperStorageClass EXIT PROCEDURE INIT PROCEDURE
|
|
69
|
|
70 " Operators
|
|
71 syn match clipperOperator "$\|%\|&\|+\|-\|->\|!"
|
|
72 syn match clipperOperator "\.AND\.\|\.NOT\.\|\.OR\."
|
|
73 syn match clipperOperator ":=\|<\|<=\|<>\|!=\|#\|=\|==\|>\|>=\|@"
|
|
74 syn match clipperOperator "*"
|
|
75
|
|
76 " Numbers
|
|
77 syn match clipperNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
|
|
78
|
|
79 " Includes
|
|
80 syn region clipperIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
81 syn match clipperIncluded contained "<[^>]*>"
|
|
82 syn match clipperInclude "^\s*#\s*include\>\s*["<]" contains=clipperIncluded
|
|
83
|
|
84 " String and Character constants
|
|
85 syn region clipperString start=+"+ end=+"+
|
|
86 syn region clipperString start=+'+ end=+'+
|
|
87
|
|
88 " Delimiters
|
|
89 syn match ClipperDelimiters "[()]\|[\[\]]\|[{}]\|[||]"
|
|
90
|
|
91 " Special
|
|
92 syn match clipperLineContinuation ";"
|
|
93
|
|
94 " This is from Bram Moolenaar:
|
|
95 if exists("c_comment_strings")
|
|
96 " A comment can contain cString, cCharacter and cNumber.
|
|
97 " But a "*/" inside a cString in a clipperComment DOES end the comment!
|
|
98 " So we need to use a special type of cString: clipperCommentString, which
|
|
99 " also ends on "*/", and sees a "*" at the start of the line as comment
|
|
100 " again. Unfortunately this doesn't very well work for // type of comments :-(
|
|
101 syntax match clipperCommentSkip contained "^\s*\*\($\|\s\+\)"
|
|
102 syntax region clipperCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=clipperCommentSkip
|
|
103 syntax region clipperComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$"
|
|
104 syntax region clipperComment start="/\*" end="\*/" contains=clipperCommentString,clipperCharacter,clipperNumber,clipperString
|
|
105 syntax match clipperComment "//.*" contains=clipperComment2String,clipperCharacter,clipperNumber
|
|
106 else
|
|
107 syn region clipperComment start="/\*" end="\*/"
|
|
108 syn match clipperComment "//.*"
|
|
109 endif
|
|
110 syntax match clipperCommentError "\*/"
|
|
111
|
|
112 " Lines beggining with an "*" are comments too
|
|
113 syntax match clipperComment "^\*.*"
|
|
114
|
|
115
|
|
116 " Define the default highlighting.
|
|
117 " For version 5.7 and earlier: only when not done already
|
|
118 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
119 if version >= 508 || !exists("did_clipper_syntax_inits")
|
|
120 if version < 508
|
|
121 let did_clipper_syntax_inits = 1
|
|
122 command -nargs=+ HiLink hi link <args>
|
|
123 else
|
|
124 command -nargs=+ HiLink hi def link <args>
|
|
125 endif
|
|
126
|
|
127 HiLink clipperConditional Conditional
|
|
128 HiLink clipperRepeat Repeat
|
|
129 HiLink clipperNumber Number
|
|
130 HiLink clipperInclude Include
|
|
131 HiLink clipperComment Comment
|
|
132 HiLink clipperOperator Operator
|
|
133 HiLink clipperStorageClass StorageClass
|
|
134 HiLink clipperStatement Statement
|
|
135 HiLink clipperString String
|
|
136 HiLink clipperFunction Function
|
|
137 HiLink clipperLineContinuation Special
|
|
138 HiLink clipperDelimiters Delimiter
|
|
139 HiLink clipperUserVariable Identifier
|
|
140
|
|
141 delcommand HiLink
|
|
142 endif
|
|
143
|
|
144 let b:current_syntax = "clipper"
|
|
145
|
3237
|
146 let &cpo = s:cpo_save
|
|
147 unlet s:cpo_save
|
|
148 " vim: ts=8
|