blob: 6310bc3bde89e1effbc9d0ec41d62e6f230eba68 [file] [log] [blame]
Bram Moolenaarc2065802005-11-25 19:50:52 +00001" Vim syntax file
Bram Moolenaar5e3dae82010-03-02 16:19:40 +01002" Language: CFML
3" Maintainer: Toby Woodwark (toby.woodwark+vim@gmail.com)
4" Last Change: 2010-03-02
5" Filenames: *.cfc *.cfm
6" Version: Adobe ColdFusion 9
7" Usage: This file contains both syntax definitions
8" and a list of known builtin tags, functions and keywords.
9" Refs -
10" http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS8f0cc78011fffa71866534d11cdad96e4e-8000.html
11" http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17324-8000.html
12" TODO:
13" Support the limited array literal and struct literal syntax in CF8+.
14" Highlight namespaced tags fom cfimport.
15" Complete CF9+ cfscript support.
16" Railo support.
17" Options:
18" d_noinclude_html - set to prevent HTML highlighting. Use this if you are not working on HTML.
Bram Moolenaarc2065802005-11-25 19:50:52 +000019
Bram Moolenaar5e3dae82010-03-02 16:19:40 +010020" Quit if a syntax file is already loaded.
21if exists("b:current_syntax")
Bram Moolenaarc2065802005-11-25 19:50:52 +000022 finish
23endif
24
Bram Moolenaar5e3dae82010-03-02 16:19:40 +010025if exists("d_noinclude_html")
26 " Define alternatives to the HTML syntax file.
27
28 " Copied from html.vim - the rules for matching a CF tag match those for HTML/SGML.
29 " CFML syntax is more permissive when it comes to superfluous <> chars.
30 syn region htmlString contained start=+"+ end=+"+ contains=@htmlPreproc
31 syn region htmlString contained start=+'+ end=+'+ contains=@htmlPreproc
32 syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=@htmlPreproc
33 " Hacked htmlTag so that it only matches cf tags and not random <> chars.
34 syn region htmlEndTag start=+</cf+ end=+>+ contains=htmlTagN,htmlTagError
35 syn region htmlTag start=+<\s*cf[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,@htmlPreproc,@htmlArgCluster
36 syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,@htmlTagNameCluster
37 syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,@htmlTagNameCluster
38 syn match htmlTagError contained "[^>]<"ms=s+1
Bram Moolenaarc2065802005-11-25 19:50:52 +000039else
Bram Moolenaar5e3dae82010-03-02 16:19:40 +010040 " Use all the stuff from the HTML syntax file.
41 " This means eg HTML comments are highlighted as comments, even if they include cf tags.
Bram Moolenaarc2065802005-11-25 19:50:52 +000042 runtime! syntax/html.vim
43endif
44
Bram Moolenaar5e3dae82010-03-02 16:19:40 +010045syn sync fromstart
46syn sync maxlines=200
47syn case ignore
Bram Moolenaarc2065802005-11-25 19:50:52 +000048
49" Scopes and keywords.
Bram Moolenaar5e3dae82010-03-02 16:19:40 +010050syn keyword cfScope contained cgi cffile cookie request caller this thistag
51syn keyword cfScope contained cfcatch variables application server session client form url local
52syn keyword cfScope contained arguments super cfhttp attributes error
53syn keyword cfBool contained yes no true false
Bram Moolenaarc2065802005-11-25 19:50:52 +000054
55" Operator strings.
Bram Moolenaar5e3dae82010-03-02 16:19:40 +010056" ColdFusion <=7:
57syn keyword cfOperator contained xor eqv and or lt le lte gt ge gte equal eq neq not is mod contains
58syn match cfOperatorMatch contained "+"
59syn match cfOperatorMatch contained "\-"
60syn match cfOperatorMatch contained "[\*\/\\\^\&][\+\-\*\/\\\^\&]\@!"
61syn match cfOperatorMatch contained "\<\(not\_s\+\)\?equal\>"
62syn match cfOperatorMatch contained "\<does\_s\+not\_s\+contain\>"
63syn match cfOperatorMatch contained "\<\(greater\|less\)\_s\+than\(\_s\+or\_s\+equal\_s\+to\)\?\>"
64" ColdFusion 8:
65syn keyword cfOperator contained imp
66syn match cfOperatorMatch contained "[?%:!]"
67syn match cfOperatorMatch contained "[\+\-\*\/\&]="
68syn match cfOperatorMatch contained "++"
69syn match cfOperatorMatch contained "--"
70syn match cfOperatorMatch contained "&&"
71syn match cfOperatorMatch contained "||"
72
73syn cluster cfOperatorCluster contains=cfOperator,cfOperatorMatch
74
75" Custom tags called with the <cf_xxx> syntax.
76syn match cfCustomTagName contained "\<cf_[a-zA-Z0-9_]\+\>"
77" (TODO match namespaced tags imported using cfimport, similarly.)
Bram Moolenaarc2065802005-11-25 19:50:52 +000078
79" Tag names.
Bram Moolenaar5e3dae82010-03-02 16:19:40 +010080" ColdFusion <=7:
81syn keyword cfTagName contained cfabort cfapplet cfapplication cfargument cfassociate
82syn keyword cfTagName contained cfbreak cfcache cfcalendar cfcase cfcatch
83syn keyword cfTagName contained cfchart cfchartdata cfchartseries cfcol cfcollection
84syn keyword cfTagName contained cfcomponent cfcontent cfcookie cfdefaultcase cfdirectory
85syn keyword cfTagName contained cfdocument cfdocumentitem cfdocumentsection cfdump cfelse
86syn keyword cfTagName contained cfelseif cferror cfexecute cfexit cffile cfflush cfform
87syn keyword cfTagName contained cfformgroup cfformitem cfftp cffunction
88syn keyword cfTagName contained cfgrid cfgridcolumn cfgridrow cfgridupdate cfheader
89syn keyword cfTagName contained cfhtmlhead cfhttp cfhttpparam cfif cfimport
90syn keyword cfTagName contained cfinclude cfindex cfinput cfinsert cfinvoke cfinvokeargument
91syn keyword cfTagName contained cfldap cflocation cflock cflog cflogin cfloginuser cflogout
92syn keyword cfTagName contained cfloop cfmail cfmailparam cfmailpart cfmodule
93syn keyword cfTagName contained cfNTauthenticate cfobject cfobjectcache cfoutput cfparam
94syn keyword cfTagName contained cfpop cfprocessingdirective cfprocparam cfprocresult
95syn keyword cfTagName contained cfproperty cfquery cfqueryparam cfregistry cfreport
96syn keyword cfTagName contained cfreportparam cfrethrow cfreturn cfsavecontent cfschedule
97syn keyword cfTagName contained cfscript cfsearch cfselect cfservletparam cfset
98syn keyword cfTagName contained cfsetting cfsilent cfslider cfstoredproc cfswitch cftable
99syn keyword cfTagName contained cftextarea cftextinput cfthrow cftimer cftrace cftransaction
100syn keyword cfTagName contained cftree cftreeitem cftry cfupdate cfwddx cfxml
101" ColdFusion 8:
102syn keyword cfTagName contained cfajaximport cfajaxproxy cfdbinfo cfdiv cfexchangecalendar
103syn keyword cfTagName contained cfexchangeconnection cfexchangecontact cfexchangefilter
104syn keyword cfTagName contained cfexchangemail cfexchangetask cffeed
105syn keyword cfTagName contained cfinterface cflayout cflayoutarea cfmenu cfmenuitem
106syn keyword cfTagName contained cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod
107syn keyword cfTagName contained cfpresentation cfpresentationslide cfpresenter cfprint
108syn keyword cfTagName contained cfsprydataset cfthread cftooltip cfwindow cfzip cfzipparam
109" ColdFusion 9:
110syn keyword cfTagName contained cfcontinue cffileupload cffinally
111syn keyword cfTagName contained cfimage cfimap
112syn keyword cfTagName contained cfmap cfmapitem cfmediaplayer cfmessagebox
113syn keyword cfTagName contained cfprocparam cfprogressbar
114syn keyword cfTagName contained cfsharepoint cfspreadsheet
Bram Moolenaarc2065802005-11-25 19:50:52 +0000115
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100116" Tag attributes.
117" XXX Not updated for ColdFusion 8/9.
118" These are becoming a headache to maintain, so might be removed.
119syn keyword cfArg contained abort accept access accessible action addnewline addtoken
120syn keyword cfArg contained agentname align appendkey appletsource application
121syn keyword cfArg contained applicationtimeout applicationtoken archive
122syn keyword cfArg contained argumentcollection arguments asciiextensionlist
123syn keyword cfArg contained attachmentpath attributecollection attributes autowidth
124syn keyword cfArg contained backgroundvisible basetag bcc bgcolor bind bindingname
125syn keyword cfArg contained blockfactor body bold border branch cachedafter cachedwithin
126syn keyword cfArg contained casesensitive category categorytree cc cfsqltype charset
127syn keyword cfArg contained chartheight chartwidth checked class clientmanagement
128syn keyword cfArg contained clientstorage codebase colheaderalign colheaderbold
129syn keyword cfArg contained colheaderfont colheaderfontsize colheaderitalic colheaders
130syn keyword cfArg contained colheadertextcolor collection colorlist colspacing columns
131syn keyword cfArg contained completepath component condition connection contentid
132syn keyword cfArg contained context contextbytes contexthighlightbegin
133syn keyword cfArg contained contexthighlightend contextpassages cookiedomain criteria
134syn keyword cfArg contained custom1 custom2 custom3 custom4 data dataalign
135syn keyword cfArg contained databackgroundcolor datacollection datasource daynames
136syn keyword cfArg contained dbname dbserver dbtype dbvarname debug default delete
137syn keyword cfArg contained deletebutton deletefile delimiter delimiters description
138syn keyword cfArg contained destination detail directory disabled display displayname
139syn keyword cfArg contained disposition dn domain editable enablecab enablecfoutputonly
140syn keyword cfArg contained enabled encoded encryption enctype enddate endrange endtime
141syn keyword cfArg contained entry errorcode exception existing expand expires expireurl
142syn keyword cfArg contained expression extendedinfo extends extensions external
143syn keyword cfArg contained failifexists failto file filefield filename filter
144syn keyword cfArg contained firstdayofweek firstrowasheaders fixnewline font fontbold
145syn keyword cfArg contained fontembed fontitalic fontsize foregroundcolor format
146syn keyword cfArg contained formfields formula from generateuniquefilenames getasbinary
147syn keyword cfArg contained grid griddataalign gridlines groovecolor group
148syn keyword cfArg contained groupcasesensitive header headeralign headerbold headerfont
149syn keyword cfArg contained headerfontsize headeritalic headerlines headertextcolor
150syn keyword cfArg contained height highlighthref hint href hrefkey hscroll hspace html
151syn keyword cfArg contained htmltable id idletimeout img imgopen imgstyle index inline
152syn keyword cfArg contained input insert insertbutton interval isolation italic item
153syn keyword cfArg contained itemcolumn key keyonly label labelformat language list
154syn keyword cfArg contained listgroups locale localfile log loginstorage lookandfeel
155syn keyword cfArg contained mailerid mailto marginbottom marginleft marginright
156syn keyword cfArg contained margintop markersize markerstyle mask max maxlength maxrows
157syn keyword cfArg contained message messagenumber method mimeattach mimetype min mode
158syn keyword cfArg contained modifytype monthnames multipart multiple name nameconflict
159syn keyword cfArg contained namespace new newdirectory notsupported null numberformat
160syn keyword cfArg contained object omit onblur onchange onclick onerror onfocus
161syn keyword cfArg contained onkeydown onkeyup onload onmousedown onmouseup onreset
162syn keyword cfArg contained onsubmit onvalidate operation orderby orientation output
163syn keyword cfArg contained outputfile overwrite ownerpassword pageencoding pageheight
164syn keyword cfArg contained pagetype pagewidth paintstyle param_1 param_2 param_3
165syn keyword cfArg contained param_4 param_5 param_6 param_7 param_8 param_9 parent
166syn keyword cfArg contained parrent passive passthrough password path pattern
167syn keyword cfArg contained permissions picturebar pieslicestyle port porttypename
168syn keyword cfArg contained prefix preloader preservedata previouscriteria procedure
169syn keyword cfArg contained protocol provider providerdsn proxybypass proxypassword
170syn keyword cfArg contained proxyport proxyserver proxyuser publish query queryasroot
171syn keyword cfArg contained queryposition range rebind recurse redirect referral
172syn keyword cfArg contained refreshlabel remotefile replyto report requesttimeout
173syn keyword cfArg contained required reset resoleurl resolveurl result resultset
174syn keyword cfArg contained retrycount returnasbinary returncode returntype
175syn keyword cfArg contained returnvariable roles rotated rowheaderalign rowheaderbold
176syn keyword cfArg contained rowheaderfont rowheaderfontsize rowheaderitalic rowheaders
177syn keyword cfArg contained rowheadertextcolor rowheaderwidth rowheight scale scalefrom
178syn keyword cfArg contained scaleto scope scriptprotect scriptsrc secure securitycontext
179syn keyword cfArg contained select selectcolor selected selecteddate selectedindex
180syn keyword cfArg contained selectmode separator seriescolor serieslabel seriesplacement
181syn keyword cfArg contained server serviceport serviceportname sessionmanagement
182syn keyword cfArg contained sessiontimeout setclientcookies setcookie setdomaincookies
183syn keyword cfArg contained show3d showborder showdebugoutput showerror showlegend
184syn keyword cfArg contained showmarkers showxgridlines showygridlines size skin sort
185syn keyword cfArg contained sortascendingbutton sortcontrol sortdescendingbutton
186syn keyword cfArg contained sortxaxis source spoolenable sql src srcfile start startdate
187syn keyword cfArg contained startrange startrow starttime status statuscode statustext
188syn keyword cfArg contained step stoponerror style subject suggestions
189syn keyword cfArg contained suppresswhitespace tablename tableowner tablequalifier
190syn keyword cfArg contained taglib target task template text textcolor textqualifier
191syn keyword cfArg contained throwonerror throwonerror throwonfailure throwontimeout
192syn keyword cfArg contained timeout timespan tipbgcolor tipstyle title to tooltip
193syn keyword cfArg contained toplevelvariable transfermode type uid unit url urlpath
194syn keyword cfArg contained useragent username userpassword usetimezoneinfo validate
195syn keyword cfArg contained validateat value valuecolumn values valuesdelimiter
196syn keyword cfArg contained valuesdisplay var variable vertical visible vscroll vspace
197syn keyword cfArg contained webservice width wmode wraptext wsdlfile xaxistitle
198syn keyword cfArg contained xaxistype xoffset yaxistitle yaxistype yoffset
Bram Moolenaarc2065802005-11-25 19:50:52 +0000199
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100200" Functions.
201" ColdFusion <=7:
202syn keyword cfFunctionName contained ACos ASin Abs AddSOAPRequestHeader AddSOAPResponseHeader
203syn keyword cfFunctionName contained ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ArrayInsertAt
204syn keyword cfFunctionName contained ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArrayNew
205syn keyword cfFunctionName contained ArrayPrepend ArrayResize ArraySet ArraySort ArraySum
206syn keyword cfFunctionName contained ArraySwap ArrayToList Asc Atn AuthenticatedContext
207syn keyword cfFunctionName contained AuthenticatedUser BinaryDecode BinaryEncode BitAnd
208syn keyword cfFunctionName contained BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN
209syn keyword cfFunctionName contained BitSHRN BitXor CJustify Ceiling CharsetDecode CharsetEncode
210syn keyword cfFunctionName contained Chr Compare CompareNoCase Cos CreateDate CreateDateTime
211syn keyword cfFunctionName contained CreateODBCDate CreateODBCDateTime CreateODBCTime
212syn keyword cfFunctionName contained CreateObject CreateTime CreateTimeSpan CreateUUID DE DateAdd
213syn keyword cfFunctionName contained DateCompare DateConvert DateDiff DateFormat DatePart Day
214syn keyword cfFunctionName contained DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear
215syn keyword cfFunctionName contained DecimalFormat DecrementValue Decrypt DecryptBinary
216syn keyword cfFunctionName contained DeleteClientVariable DirectoryExists DollarFormat Duplicate
217syn keyword cfFunctionName contained Encrypt EncryptBinary Evaluate Exp ExpandPath FileExists
218syn keyword cfFunctionName contained Find FindNoCase FindOneOf FirstDayOfMonth Fix FormatBaseN
219syn keyword cfFunctionName contained GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList
220syn keyword cfFunctionName contained GetBaseTemplatePath GetClientVariablesList GetContextRoot
221syn keyword cfFunctionName contained GetCurrentTemplatePath GetDirectoryFromPath GetEncoding
222syn keyword cfFunctionName contained GetException GetFileFromPath GetFunctionList
223syn keyword cfFunctionName contained GetGatewayHelper GetHttpRequestData GetHttpTimeString
224syn keyword cfFunctionName contained GetLocalHostIP
225syn keyword cfFunctionName contained GetLocale GetLocaleDisplayName GetMetaData GetMetricData
226syn keyword cfFunctionName contained GetPageContext GetProfileSections GetProfileString
227syn keyword cfFunctionName contained GetSOAPRequest GetSOAPRequestHeader GetSOAPResponse
228syn keyword cfFunctionName contained GetSOAPResponseHeader GetTempDirectory GetTempFile
229syn keyword cfFunctionName contained GetTickCount GetTimeZoneInfo GetToken
230syn keyword cfFunctionName contained HTMLCodeFormat HTMLEditFormat Hash Hour IIf IncrementValue
231syn keyword cfFunctionName contained InputBaseN Insert Int IsArray IsAuthenticated IsAuthorized
232syn keyword cfFunctionName contained IsBinary IsBoolean IsCustomFunction IsDate IsDebugMode
233syn keyword cfFunctionName contained IsDefined
234syn keyword cfFunctionName contained IsLeapYear IsLocalHost IsNumeric
235syn keyword cfFunctionName contained IsNumericDate IsObject IsProtected IsQuery IsSOAPRequest
236syn keyword cfFunctionName contained IsSimpleValue IsStruct IsUserInRole IsValid IsWDDX IsXML
237syn keyword cfFunctionName contained IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot
238syn keyword cfFunctionName contained JSStringFormat JavaCast LCase LJustify LSCurrencyFormat
239syn keyword cfFunctionName contained LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate
240syn keyword cfFunctionName contained LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime
241syn keyword cfFunctionName contained LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Left
242syn keyword cfFunctionName contained Len ListAppend ListChangeDelims ListContains
243syn keyword cfFunctionName contained ListContainsNoCase ListDeleteAt ListFind ListFindNoCase
244syn keyword cfFunctionName contained ListFirst ListGetAt ListInsertAt ListLast ListLen
245syn keyword cfFunctionName contained ListPrepend ListQualify ListRest ListSetAt ListSort
246syn keyword cfFunctionName contained ListToArray ListValueCount ListValueCountNoCase Log Log10
247syn keyword cfFunctionName contained Max Mid Min Minute Month MonthAsString Now NumberFormat
248syn keyword cfFunctionName contained ParagraphFormat ParseDateTime Pi
249syn keyword cfFunctionName contained PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow
250syn keyword cfFunctionName contained QueryNew QuerySetCell QuotedValueList REFind REFindNoCase
251syn keyword cfFunctionName contained REReplace REReplaceNoCase RJustify RTrim Rand RandRange
252syn keyword cfFunctionName contained Randomize ReleaseComObject RemoveChars RepeatString Replace
253syn keyword cfFunctionName contained ReplaceList ReplaceNoCase Reverse Right Round Second
254syn keyword cfFunctionName contained SendGatewayMessage SetEncoding SetLocale SetProfileString
255syn keyword cfFunctionName contained SetVariable Sgn Sin SpanExcluding SpanIncluding Sqr StripCR
256syn keyword cfFunctionName contained StructAppend StructClear StructCopy StructCount StructDelete
257syn keyword cfFunctionName contained StructFind StructFindKey StructFindValue StructGet
258syn keyword cfFunctionName contained StructInsert StructIsEmpty StructKeyArray StructKeyExists
259syn keyword cfFunctionName contained StructKeyList StructNew StructSort StructUpdate Tan
260syn keyword cfFunctionName contained TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase
261syn keyword cfFunctionName contained URLDecode URLEncodedFormat URLSessionFormat Val ValueList
262syn keyword cfFunctionName contained Week Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat
263syn keyword cfFunctionName contained XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform
264syn keyword cfFunctionName contained XmlValidate Year YesNoFormat
265" ColdFusion 8:
266syn keyword cfFunctionName contained AjaxLink AjaxOnLoad ArrayIsDefined BinaryDecode BinaryEncode CharsetDecode CharsetEncode
267syn keyword cfFunctionName contained DecryptBinary DeserializeJSON DotNetToCFType EncryptBinary FileClose FileCopy FileDelete
268syn keyword cfFunctionName contained FileIsEOF FileMove FileOpen FileRead FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute
269syn keyword cfFunctionName contained FileSetLastModified FileWrite GenerateSecretKey GetGatewayHelper GetAuthUser GetComponentMetaData
270syn keyword cfFunctionName contained GetContextRoot GetEncoding GetFileInfo GetLocaleDisplayName GetLocalHostIP GetMetaData
271syn keyword cfFunctionName contained GetPageContext GetPrinterInfo GetProfileSections GetReadableImageFormats GetSOAPRequest
272syn keyword cfFunctionName contained GetSOAPRequestHeader GetSOAPResponse GetSOAPResponseHeader GetUserRoles GetWriteableImageFormats
273syn keyword cfFunctionName contained ImageAddBorder ImageBlur ImageClearRect ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect
274syn keyword cfFunctionName contained ImageDrawCubicCurve ImageDrawPoint ImageDrawLine ImageDrawLines ImageDrawOval
275syn keyword cfFunctionName contained ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob
276syn keyword cfFunctionName contained ImageGetBufferedImage ImageGetEXIFMetadata ImageGetEXIFTag ImageGetHeight ImageGetIPTCMetadata
277syn keyword cfFunctionName contained ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay
278syn keyword cfFunctionName contained ImagePaste ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit
279" ColdFusion 9:
280syn keyword cfFunctionName contained ApplicationStop ArrayContains ArrayDelete ArrayFind ArrayFindNoCase IsSpreadsheetFile
281syn keyword cfFunctionName contained IsSpreadsheetObject FileSkipBytes Location ObjectLoad SpreadsheetFormatColumn
282syn keyword cfFunctionName contained SpreadsheetFormatColumns SpreadsheetFormatRow SpreadsheetFormatRows SpreadsheetGetCellComment
283syn keyword cfFunctionName contained CacheGetAllIds CacheGetMetadata CacheGetProperties CacheGet CachePut ObjectSave ORMClearSession
284syn keyword cfFunctionName contained ORMCloseSession ORMEvictQueries ORMEvictCollection SpreadsheetGetCellFormula SpreadsheetGetCellValue
285syn keyword cfFunctionName contained SpreadsheetInfo SpreadsheetMergeCells SpreadsheetNew CacheRemove CacheSetProperties DirectoryCreate
286syn keyword cfFunctionName contained DirectoryDelete DirectoryExists ORMEvictEntity ORMEvictQueries ORMExecuteQuery ORMFlush
287syn keyword cfFunctionName contained ORMGetSession SpreadsheetRead SpreadsheetReadBinary SpreadsheetSetActiveSheetNumber
288syn keyword cfFunctionName contained SpreadsheetSetCellComment SpreadsheetSetCellFormula DirectoryList DirectoryRename EntityDelete
289syn keyword cfFunctionName contained EntityLoad EntityLoadByExample ORMGetSessionFactory ORMReload ObjectEquals SpreadsheetAddColumn
290syn keyword cfFunctionName contained SpreadsheetAddFreezePane SpreadsheetSetCellValue SpreadsheetSetActiveSheet SpreadsheetSetFooter
291syn keyword cfFunctionName contained SpreadsheetSetHeader SpreadsheetSetColumnWidth EntityLoadByPK EntityMerge EntityNew EntityReload
292syn keyword cfFunctionName contained EntitySave SpreadsheetAddImage SpreadsheetAddInfo SpreadsheetAddRow SpreadsheetAddRows
293syn keyword cfFunctionName contained SpreadsheetAddSplitPane SpreadsheetShiftColumns SpreadsheetShiftRows SpreadsheetSetRowHeight
294syn keyword cfFunctionName contained SpreadsheetWrite Trace FileDelete FileSeek FileWriteLine GetFunctionCalledName GetVFSMetaData IsIPv6
295syn keyword cfFunctionName contained IsNull SpreadsheetCreateSheet SpreadsheetDeleteColumn SpreadsheetDeleteColumns SpreadsheetDeleteRow
296syn keyword cfFunctionName contained SpreadsheetDeleteRows SpreadsheetFormatCell TransactionCommit TransactionRollback
297syn keyword cfFunctionName contained TransactionSetSavePoint ThreadTerminate ThreadJoin Throw Writedump Writelog
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000298
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100299" Deprecated or obsoleted tags and functions.
300syn keyword cfDeprecatedTag contained cfauthenticate cfimpersonate cfgraph cfgraphdata
301syn keyword cfDeprecatedTag contained cfservlet cfservletparam cftextinput
302syn keyword cfDeprecatedTag contained cfinternaladminsecurity cfnewinternaladminsecurity
303syn keyword cfDeprecatedFunction contained GetK2ServerDocCount GetK2ServerDocCountLimit GetTemplatePath
304syn keyword cfDeprecatedFunction contained IsK2ServerABroker IsK2ServerDocCountExceeded IsK2ServerOnline
305syn keyword cfDeprecatedFunction contained ParameterExists AuthenticatedContext AuthenticatedUser
306syn keyword cfDeprecatedFunction contained isAuthenticated isAuthorized isProtected
Bram Moolenaarc2065802005-11-25 19:50:52 +0000307
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100308" Add to the HTML clusters.
309syn cluster htmlTagNameCluster add=cfTagName,cfCustomTagName,cfDeprecatedTag
310syn cluster htmlArgCluster add=cfArg,cfHashRegion,cfScope
311syn cluster htmlPreproc add=cfHashRegion
Bram Moolenaarc2065802005-11-25 19:50:52 +0000312
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100313syn cluster cfExpressionCluster contains=cfFunctionName,cfScope,@cfOperatorCluster,cfScriptStringD,cfScriptStringS,cfScriptNumber,cfBool,cfComment
Bram Moolenaarc2065802005-11-25 19:50:52 +0000314
315" Evaluation; skip strings ( this helps with cases like nested IIf() )
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100316" containedin to add to the TOP of cfOutputRegion.
317syn region cfHashRegion start=+#+ skip=+"[^"]*"\|'[^']*'+ end=+#+ contained containedin=cfOutputRegion contains=@cfExpressionCluster,cfScriptParenError
318
319" Hashmarks are significant inside cfoutput tags.
320" cfoutput tags may be nested indefinitely.
321syn region cfOutputRegion matchgroup=NONE transparent start=+<cfoutput>+ end=+</cfoutput>+ contains=TOP
Bram Moolenaarc2065802005-11-25 19:50:52 +0000322
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000323" <cfset>, <cfif>, <cfelseif>, <cfreturn> are analogous to hashmarks (implicit
324" evaluation) and have 'var'
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100325syn region cfSetRegion start="<cfset\>" start="<cfreturn\>" start="<cfelseif\>" start="<cfif\>" end='>' keepend contains=@cfExpressionCluster,cfSetLHSRegion,cfSetTagEnd,cfScriptStatement
326syn region cfSetLHSRegion contained start="<cfreturn" start="<cfelseif" start="<cfif" start="<cfset" end="." keepend contains=cfTagName,htmlTag
327syn match cfSetTagEnd contained '>'
Bram Moolenaarc2065802005-11-25 19:50:52 +0000328
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100329" CF comments: similar to SGML comments, but can be nested.
330syn region cfComment start='<!---' end='--->' contains=cfCommentTodo,cfComment
331syn keyword cfCommentTodo contained TODO FIXME XXX TBD WTF
Bram Moolenaarc2065802005-11-25 19:50:52 +0000332
333" CFscript
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100334" TODO better support for new component/function def syntax
335" TODO better support for 'new'
336" TODO highlight metadata (@ ...) inside comments.
337syn match cfScriptLineComment contained "\/\/.*$" contains=cfCommentTodo
338syn region cfScriptComment contained start="/\*" end="\*/" contains=cfCommentTodo
339syn match cfScriptBraces contained "[{}]"
340syn keyword cfScriptStatement contained return var
Bram Moolenaarc2065802005-11-25 19:50:52 +0000341" in CF, quotes are escaped by doubling
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100342syn region cfScriptStringD contained start=+"+ skip=+\\\\\|""+ end=+"+ extend contains=@htmlPreproc,cfHashRegion
343syn region cfScriptStringS contained start=+'+ skip=+\\\\\|''+ end=+'+ extend contains=@htmlPreproc,cfHashRegion
344syn match cfScriptNumber contained "\<\d\+\>"
345syn keyword cfScriptConditional contained if else
346syn keyword cfScriptRepeat contained while for in
347syn keyword cfScriptBranch contained break switch case default try catch continue finally
348syn keyword cfScriptKeyword contained function
349" argumentCollection is a special argument to function calls
350syn keyword cfScriptSpecial contained argumentcollection
351" ColdFusion 9:
352syn keyword cfScriptStatement contained new import
353" CFscript equivalents of some tags
354syn keyword cfScriptKeyword contained abort component exit import include
355syn keyword cfScriptKeyword contained interface param pageencoding property rethrow thread transaction
356" function/component syntax
357syn keyword cfScriptSpecial contained required extends
Bram Moolenaarc2065802005-11-25 19:50:52 +0000358
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100359
360syn cluster cfScriptCluster contains=cfScriptParen,cfScriptLineComment,cfScriptComment,cfScriptStringD,cfScriptStringS,cfScriptFunction,cfScriptNumber,cfScriptRegexpString,cfScriptBoolean,cfScriptBraces,cfHashRegion,cfFunctionName,cfDeprecatedFunction,cfScope,@cfOperatorCluster,cfScriptConditional,cfScriptRepeat,cfScriptBranch,@cfExpressionCluster,cfScriptStatement,cfScriptSpecial,cfScriptKeyword
Bram Moolenaarc2065802005-11-25 19:50:52 +0000361
362" Errors caused by wrong parenthesis; skip strings
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100363syn region cfScriptParen contained transparent skip=+"[^"]*"\|'[^']*'+ start=+(+ end=+)+ contains=@cfScriptCluster
364syn match cfScrParenError contained +)+
Bram Moolenaarc2065802005-11-25 19:50:52 +0000365
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100366syn region cfscriptBlock matchgroup=NONE start="<cfscript>" end="<\/cfscript>"me=s-1 keepend contains=@cfScriptCluster,cfscriptTag,cfScrParenError
367syn region cfscriptTag contained start='<cfscript' end='>' keepend contains=cfTagName,htmlTag
Bram Moolenaarc2065802005-11-25 19:50:52 +0000368
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000369" CFML
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100370syn cluster cfmlCluster contains=cfComment,@htmlTagNameCluster,@htmlPreproc,cfSetRegion,cfscriptBlock,cfOutputRegion
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000371
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100372" cfquery = sql syntax
373if exists("b:current_syntax")
374 unlet b:current_syntax
Bram Moolenaarc2065802005-11-25 19:50:52 +0000375endif
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100376syn include @cfSql $VIMRUNTIME/syntax/sql.vim
377unlet b:current_syntax
378syn region cfqueryTag contained start=+<cfquery+ end=+>+ keepend contains=cfTagName,htmlTag
379syn region cfSqlregion start=+<cfquery\_[^>]*>+ keepend end=+</cfquery>+me=s-1 matchgroup=NONE contains=@cfSql,cfComment,@htmlTagNameCluster,cfqueryTag,cfHashRegion
380
381" Define the highlighting.
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100382
383if exists("d_noinclude_html")
384 " The default html-style highlighting copied from html.vim.
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200385 hi def link htmlTag Function
386 hi def link htmlEndTag Identifier
387 hi def link htmlArg Type
388 hi def link htmlTagName htmlStatement
389 hi def link htmlValue String
390 hi def link htmlPreProc PreProc
391 hi def link htmlString String
392 hi def link htmlStatement Statement
393 hi def link htmlValue String
394 hi def link htmlTagError htmlError
395 hi def link htmlError Error
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100396endif
397
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200398hi def link cfTagName Statement
399hi def link cfCustomTagName Statement
400hi def link cfArg Type
401hi def link cfFunctionName Function
402hi def link cfHashRegion PreProc
403hi def link cfComment Comment
404hi def link cfCommentTodo Todo
405hi def link cfOperator Operator
406hi def link cfOperatorMatch Operator
407hi def link cfScope Title
408hi def link cfBool Constant
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100409
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200410hi def link cfscriptBlock Special
411hi def link cfscriptTag htmlTag
412hi def link cfSetRegion PreProc
413hi def link cfSetLHSRegion htmlTag
414hi def link cfSetTagEnd htmlTag
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100415
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200416hi def link cfScriptLineComment Comment
417hi def link cfScriptComment Comment
418hi def link cfScriptStringS String
419hi def link cfScriptStringD String
420hi def link cfScriptNumber cfScriptValue
421hi def link cfScriptConditional Conditional
422hi def link cfScriptRepeat Repeat
423hi def link cfScriptBranch Conditional
424hi def link cfScriptSpecial Type
425hi def link cfScriptStatement Statement
426hi def link cfScriptBraces Function
427hi def link cfScriptKeyword Function
428hi def link cfScriptError Error
429hi def link cfDeprecatedTag Error
430hi def link cfDeprecatedFunction Error
431hi def link cfScrParenError cfScriptError
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100432
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200433hi def link cfqueryTag htmlTag
Bram Moolenaarc2065802005-11-25 19:50:52 +0000434
435let b:current_syntax = "cf"
436
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100437" vim: nowrap sw=2 ts=8 noet