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