Updated runtime an documentation files.
diff --git a/runtime/syntax/cf.vim b/runtime/syntax/cf.vim
index bda24d7..63d976d 100644
--- a/runtime/syntax/cf.vim
+++ b/runtime/syntax/cf.vim
@@ -1,321 +1,440 @@
" Vim syntax file
-" Language: ColdFusion
-" Maintainer: Toby Woodwark (toby.woodwark+vim@gmail.com)
-" Last Change: 2007 Nov 19
-" Filenames: *.cfc *.cfm
-" Version: Macromedia ColdFusion MX 7
-" Usage: Note that ColdFusion has its own comment syntax
-" i.e. <!--- --->
+" Language: CFML
+" Maintainer: Toby Woodwark (toby.woodwark+vim@gmail.com)
+" Last Change: 2010-03-02
+" Filenames: *.cfc *.cfm
+" Version: Adobe ColdFusion 9
+" Usage: This file contains both syntax definitions
+" and a list of known builtin tags, functions and keywords.
+" Refs -
+" http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS8f0cc78011fffa71866534d11cdad96e4e-8000.html
+" http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17324-8000.html
+" TODO:
+" Support the limited array literal and struct literal syntax in CF8+.
+" Highlight namespaced tags fom cfimport.
+" Complete CF9+ cfscript support.
+" Railo support.
+" Options:
+" d_noinclude_html - set to prevent HTML highlighting. Use this if you are not working on HTML.
-" For version 5.x, clear all syntax items.
-" For version 6.x+, quit if a syntax file is already loaded.
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+" Quit if a syntax file is already loaded.
+if exists("b:current_syntax")
finish
endif
-" Use all the stuff from the HTML syntax file.
-" TODO remove this; CFML is not a superset of HTML
-if version < 600
- source <sfile>:p:h/html.vim
+if exists("d_noinclude_html")
+ " Define alternatives to the HTML syntax file.
+
+ " Copied from html.vim - the rules for matching a CF tag match those for HTML/SGML.
+ " CFML syntax is more permissive when it comes to superfluous <> chars.
+ syn region htmlString contained start=+"+ end=+"+ contains=@htmlPreproc
+ syn region htmlString contained start=+'+ end=+'+ contains=@htmlPreproc
+ syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=@htmlPreproc
+ " Hacked htmlTag so that it only matches cf tags and not random <> chars.
+ syn region htmlEndTag start=+</cf+ end=+>+ contains=htmlTagN,htmlTagError
+ syn region htmlTag start=+<\s*cf[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,@htmlPreproc,@htmlArgCluster
+ syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,@htmlTagNameCluster
+ syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,@htmlTagNameCluster
+ syn match htmlTagError contained "[^>]<"ms=s+1
else
+ " Use all the stuff from the HTML syntax file.
+ " This means eg HTML comments are highlighted as comments, even if they include cf tags.
runtime! syntax/html.vim
endif
-syn sync fromstart
-syn sync maxlines=200
-syn case ignore
+syn sync fromstart
+syn sync maxlines=200
+syn case ignore
" Scopes and keywords.
-syn keyword cfScope contained cgi cffile cookie request caller this thistag
-syn keyword cfScope contained cfcatch variables application server session client form url attributes
-syn keyword cfScope contained arguments
-syn keyword cfBool contained yes no true false
+syn keyword cfScope contained cgi cffile cookie request caller this thistag
+syn keyword cfScope contained cfcatch variables application server session client form url local
+syn keyword cfScope contained arguments super cfhttp attributes error
+syn keyword cfBool contained yes no true false
" Operator strings.
-syn keyword cfOperator contained xor eqv and or lt le lte gt ge gte equal eq neq not is mod contains
-syn match cfOperatorMatch contained "\<does\_s\+not\_s\+contain\>"
-syn match cfOperatorMatch contained "\<\(greater\|less\)\_s\+than\(\_s\+or\_s\+equal\_s\+to\)\?\>"
-syn match cfOperatorMatch contained "[\+\-\*\/\\\^\&][\+\-\*\/\\\^\&]\@!"
-syn cluster cfOperatorCluster contains=cfOperator,cfOperatorMatch
+" ColdFusion <=7:
+syn keyword cfOperator contained xor eqv and or lt le lte gt ge gte equal eq neq not is mod contains
+syn match cfOperatorMatch contained "+"
+syn match cfOperatorMatch contained "\-"
+syn match cfOperatorMatch contained "[\*\/\\\^\&][\+\-\*\/\\\^\&]\@!"
+syn match cfOperatorMatch contained "\<\(not\_s\+\)\?equal\>"
+syn match cfOperatorMatch contained "\<does\_s\+not\_s\+contain\>"
+syn match cfOperatorMatch contained "\<\(greater\|less\)\_s\+than\(\_s\+or\_s\+equal\_s\+to\)\?\>"
+" ColdFusion 8:
+syn keyword cfOperator contained imp
+syn match cfOperatorMatch contained "[?%:!]"
+syn match cfOperatorMatch contained "[\+\-\*\/\&]="
+syn match cfOperatorMatch contained "++"
+syn match cfOperatorMatch contained "--"
+syn match cfOperatorMatch contained "&&"
+syn match cfOperatorMatch contained "||"
+
+syn cluster cfOperatorCluster contains=cfOperator,cfOperatorMatch
+
+" Custom tags called with the <cf_xxx> syntax.
+syn match cfCustomTagName contained "\<cf_[a-zA-Z0-9_]\+\>"
+" (TODO match namespaced tags imported using cfimport, similarly.)
" Tag names.
-syn keyword cfTagName contained cfabort cfapplet cfapplication cfargument cfassociate
-syn keyword cfTagName contained cfbreak cfcache cfcalendar cfcase cfcatch
-syn keyword cfTagName contained cfchart cfchartdata cfchartseries cfcol cfcollection
-syn keyword cfTagName contained cfcomponent cfcontent cfcookie cfdefaultcase cfdirectory
-syn keyword cfTagName contained cfdocument cfdocumentitem cfdocumentsection cfdump cfelse
-syn keyword cfTagName contained cfelseif cferror cfexecute cfexit cffile cfflush cfform
-syn keyword cfTagName contained cfformgroup cfformitem cfftp cffunction cfgraph cfgraphdata
-syn keyword cfTagName contained cfgrid cfgridcolumn cfgridrow cfgridupdate cfheader
-syn keyword cfTagName contained cfhtmlhead cfhttp cfhttpparam cfif cfimport
-syn keyword cfTagName contained cfinclude cfindex cfinput cfinsert cfinvoke cfinvokeargument
-syn keyword cfTagName contained cfldap cflocation cflock cflog cflogin cfloginuser cflogout
-syn keyword cfTagName contained cfloop cfmail cfmailparam cfmailpart cfmodule
-syn keyword cfTagName contained cfNTauthenticate cfobject cfobjectcache cfoutput cfparam
-syn keyword cfTagName contained cfpop cfprocessingdirective cfprocparam cfprocresult
-syn keyword cfTagName contained cfproperty cfquery cfqueryparam cfregistry cfreport
-syn keyword cfTagName contained cfreportparam cfrethrow cfreturn cfsavecontent cfschedule
-syn keyword cfTagName contained cfscript cfsearch cfselect cfservlet cfservletparam cfset
-syn keyword cfTagName contained cfsetting cfsilent cfslider cfstoredproc cfswitch cftable
-syn keyword cfTagName contained cftextarea cftextinput cfthrow cftimer cftrace cftransaction
-syn keyword cfTagName contained cftree cftreeitem cftry cfupdate cfwddx cfxml
+" ColdFusion <=7:
+syn keyword cfTagName contained cfabort cfapplet cfapplication cfargument cfassociate
+syn keyword cfTagName contained cfbreak cfcache cfcalendar cfcase cfcatch
+syn keyword cfTagName contained cfchart cfchartdata cfchartseries cfcol cfcollection
+syn keyword cfTagName contained cfcomponent cfcontent cfcookie cfdefaultcase cfdirectory
+syn keyword cfTagName contained cfdocument cfdocumentitem cfdocumentsection cfdump cfelse
+syn keyword cfTagName contained cfelseif cferror cfexecute cfexit cffile cfflush cfform
+syn keyword cfTagName contained cfformgroup cfformitem cfftp cffunction
+syn keyword cfTagName contained cfgrid cfgridcolumn cfgridrow cfgridupdate cfheader
+syn keyword cfTagName contained cfhtmlhead cfhttp cfhttpparam cfif cfimport
+syn keyword cfTagName contained cfinclude cfindex cfinput cfinsert cfinvoke cfinvokeargument
+syn keyword cfTagName contained cfldap cflocation cflock cflog cflogin cfloginuser cflogout
+syn keyword cfTagName contained cfloop cfmail cfmailparam cfmailpart cfmodule
+syn keyword cfTagName contained cfNTauthenticate cfobject cfobjectcache cfoutput cfparam
+syn keyword cfTagName contained cfpop cfprocessingdirective cfprocparam cfprocresult
+syn keyword cfTagName contained cfproperty cfquery cfqueryparam cfregistry cfreport
+syn keyword cfTagName contained cfreportparam cfrethrow cfreturn cfsavecontent cfschedule
+syn keyword cfTagName contained cfscript cfsearch cfselect cfservletparam cfset
+syn keyword cfTagName contained cfsetting cfsilent cfslider cfstoredproc cfswitch cftable
+syn keyword cfTagName contained cftextarea cftextinput cfthrow cftimer cftrace cftransaction
+syn keyword cfTagName contained cftree cftreeitem cftry cfupdate cfwddx cfxml
+" ColdFusion 8:
+syn keyword cfTagName contained cfajaximport cfajaxproxy cfdbinfo cfdiv cfexchangecalendar
+syn keyword cfTagName contained cfexchangeconnection cfexchangecontact cfexchangefilter
+syn keyword cfTagName contained cfexchangemail cfexchangetask cffeed
+syn keyword cfTagName contained cfinterface cflayout cflayoutarea cfmenu cfmenuitem
+syn keyword cfTagName contained cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod
+syn keyword cfTagName contained cfpresentation cfpresentationslide cfpresenter cfprint
+syn keyword cfTagName contained cfsprydataset cfthread cftooltip cfwindow cfzip cfzipparam
+" ColdFusion 9:
+syn keyword cfTagName contained cfcontinue cffileupload cffinally
+syn keyword cfTagName contained cfimage cfimap
+syn keyword cfTagName contained cfmap cfmapitem cfmediaplayer cfmessagebox
+syn keyword cfTagName contained cfprocparam cfprogressbar
+syn keyword cfTagName contained cfsharepoint cfspreadsheet
-" Tag parameters.
-syn keyword cfArg contained abort accept access accessible action addnewline addtoken
-syn keyword cfArg contained agentname align appendkey appletsource application
-syn keyword cfArg contained applicationtimeout applicationtoken archive
-syn keyword cfArg contained argumentcollection arguments asciiextensionlist
-syn keyword cfArg contained attachmentpath attributecollection attributes autowidth
-syn keyword cfArg contained backgroundvisible basetag bcc bgcolor bind bindingname
-syn keyword cfArg contained blockfactor body bold border branch cachedafter cachedwithin
-syn keyword cfArg contained casesensitive category categorytree cc cfsqltype charset
-syn keyword cfArg contained chartheight chartwidth checked class clientmanagement
-syn keyword cfArg contained clientstorage codebase colheaderalign colheaderbold
-syn keyword cfArg contained colheaderfont colheaderfontsize colheaderitalic colheaders
-syn keyword cfArg contained colheadertextcolor collection colorlist colspacing columns
-syn keyword cfArg contained completepath component condition connection contentid
-syn keyword cfArg contained context contextbytes contexthighlightbegin
-syn keyword cfArg contained contexthighlightend contextpassages cookiedomain criteria
-syn keyword cfArg contained custom1 custom2 custom3 custom4 data dataalign
-syn keyword cfArg contained databackgroundcolor datacollection datasource daynames
-syn keyword cfArg contained dbname dbserver dbtype dbvarname debug default delete
-syn keyword cfArg contained deletebutton deletefile delimiter delimiters description
-syn keyword cfArg contained destination detail directory disabled display displayname
-syn keyword cfArg contained disposition dn domain editable enablecab enablecfoutputonly
-syn keyword cfArg contained enabled encoded encryption enctype enddate endrange endtime
-syn keyword cfArg contained entry errorcode exception existing expand expires expireurl
-syn keyword cfArg contained expression extendedinfo extends extensions external
-syn keyword cfArg contained failifexists failto file filefield filename filter
-syn keyword cfArg contained firstdayofweek firstrowasheaders fixnewline font fontbold
-syn keyword cfArg contained fontembed fontitalic fontsize foregroundcolor format
-syn keyword cfArg contained formfields formula from generateuniquefilenames getasbinary
-syn keyword cfArg contained grid griddataalign gridlines groovecolor group
-syn keyword cfArg contained groupcasesensitive header headeralign headerbold headerfont
-syn keyword cfArg contained headerfontsize headeritalic headerlines headertextcolor
-syn keyword cfArg contained height highlighthref hint href hrefkey hscroll hspace html
-syn keyword cfArg contained htmltable id idletimeout img imgopen imgstyle index inline
-syn keyword cfArg contained input insert insertbutton interval isolation italic item
-syn keyword cfArg contained itemcolumn key keyonly label labelformat language list
-syn keyword cfArg contained listgroups locale localfile log loginstorage lookandfeel
-syn keyword cfArg contained mailerid mailto marginbottom marginleft marginright
-syn keyword cfArg contained margintop markersize markerstyle mask max maxlength maxrows
-syn keyword cfArg contained message messagenumber method mimeattach mimetype min mode
-syn keyword cfArg contained modifytype monthnames multipart multiple name nameconflict
-syn keyword cfArg contained namespace new newdirectory notsupported null numberformat
-syn keyword cfArg contained object omit onblur onchange onclick onerror onfocus
-syn keyword cfArg contained onkeydown onkeyup onload onmousedown onmouseup onreset
-syn keyword cfArg contained onsubmit onvalidate operation orderby orientation output
-syn keyword cfArg contained outputfile overwrite ownerpassword pageencoding pageheight
-syn keyword cfArg contained pagetype pagewidth paintstyle param_1 param_2 param_3
-syn keyword cfArg contained param_4 param_5 param_6 param_7 param_8 param_9 parent
-syn keyword cfArg contained parrent passive passthrough password path pattern
-syn keyword cfArg contained permissions picturebar pieslicestyle port porttypename
-syn keyword cfArg contained prefix preloader preservedata previouscriteria procedure
-syn keyword cfArg contained protocol provider providerdsn proxybypass proxypassword
-syn keyword cfArg contained proxyport proxyserver proxyuser publish query queryasroot
-syn keyword cfArg contained queryposition range rebind recurse redirect referral
-syn keyword cfArg contained refreshlabel remotefile replyto report requesttimeout
-syn keyword cfArg contained required reset resoleurl resolveurl result resultset
-syn keyword cfArg contained retrycount returnasbinary returncode returntype
-syn keyword cfArg contained returnvariable roles rotated rowheaderalign rowheaderbold
-syn keyword cfArg contained rowheaderfont rowheaderfontsize rowheaderitalic rowheaders
-syn keyword cfArg contained rowheadertextcolor rowheaderwidth rowheight scale scalefrom
-syn keyword cfArg contained scaleto scope scriptprotect scriptsrc secure securitycontext
-syn keyword cfArg contained select selectcolor selected selecteddate selectedindex
-syn keyword cfArg contained selectmode separator seriescolor serieslabel seriesplacement
-syn keyword cfArg contained server serviceport serviceportname sessionmanagement
-syn keyword cfArg contained sessiontimeout setclientcookies setcookie setdomaincookies
-syn keyword cfArg contained show3d showborder showdebugoutput showerror showlegend
-syn keyword cfArg contained showmarkers showxgridlines showygridlines size skin sort
-syn keyword cfArg contained sortascendingbutton sortcontrol sortdescendingbutton
-syn keyword cfArg contained sortxaxis source spoolenable sql src srcfile start startdate
-syn keyword cfArg contained startrange startrow starttime status statuscode statustext
-syn keyword cfArg contained step stoponerror style subject suggestions
-syn keyword cfArg contained suppresswhitespace tablename tableowner tablequalifier
-syn keyword cfArg contained taglib target task template text textcolor textqualifier
-syn keyword cfArg contained throwonerror throwonerror throwonfailure throwontimeout
-syn keyword cfArg contained timeout timespan tipbgcolor tipstyle title to tooltip
-syn keyword cfArg contained toplevelvariable transfermode type uid unit url urlpath
-syn keyword cfArg contained useragent username userpassword usetimezoneinfo validate
-syn keyword cfArg contained validateat value valuecolumn values valuesdelimiter
-syn keyword cfArg contained valuesdisplay var variable vertical visible vscroll vspace
-syn keyword cfArg contained webservice width wmode wraptext wsdlfile xaxistitle
-syn keyword cfArg contained xaxistype xoffset yaxistitle yaxistype yoffset
+" Tag attributes.
+" XXX Not updated for ColdFusion 8/9.
+" These are becoming a headache to maintain, so might be removed.
+syn keyword cfArg contained abort accept access accessible action addnewline addtoken
+syn keyword cfArg contained agentname align appendkey appletsource application
+syn keyword cfArg contained applicationtimeout applicationtoken archive
+syn keyword cfArg contained argumentcollection arguments asciiextensionlist
+syn keyword cfArg contained attachmentpath attributecollection attributes autowidth
+syn keyword cfArg contained backgroundvisible basetag bcc bgcolor bind bindingname
+syn keyword cfArg contained blockfactor body bold border branch cachedafter cachedwithin
+syn keyword cfArg contained casesensitive category categorytree cc cfsqltype charset
+syn keyword cfArg contained chartheight chartwidth checked class clientmanagement
+syn keyword cfArg contained clientstorage codebase colheaderalign colheaderbold
+syn keyword cfArg contained colheaderfont colheaderfontsize colheaderitalic colheaders
+syn keyword cfArg contained colheadertextcolor collection colorlist colspacing columns
+syn keyword cfArg contained completepath component condition connection contentid
+syn keyword cfArg contained context contextbytes contexthighlightbegin
+syn keyword cfArg contained contexthighlightend contextpassages cookiedomain criteria
+syn keyword cfArg contained custom1 custom2 custom3 custom4 data dataalign
+syn keyword cfArg contained databackgroundcolor datacollection datasource daynames
+syn keyword cfArg contained dbname dbserver dbtype dbvarname debug default delete
+syn keyword cfArg contained deletebutton deletefile delimiter delimiters description
+syn keyword cfArg contained destination detail directory disabled display displayname
+syn keyword cfArg contained disposition dn domain editable enablecab enablecfoutputonly
+syn keyword cfArg contained enabled encoded encryption enctype enddate endrange endtime
+syn keyword cfArg contained entry errorcode exception existing expand expires expireurl
+syn keyword cfArg contained expression extendedinfo extends extensions external
+syn keyword cfArg contained failifexists failto file filefield filename filter
+syn keyword cfArg contained firstdayofweek firstrowasheaders fixnewline font fontbold
+syn keyword cfArg contained fontembed fontitalic fontsize foregroundcolor format
+syn keyword cfArg contained formfields formula from generateuniquefilenames getasbinary
+syn keyword cfArg contained grid griddataalign gridlines groovecolor group
+syn keyword cfArg contained groupcasesensitive header headeralign headerbold headerfont
+syn keyword cfArg contained headerfontsize headeritalic headerlines headertextcolor
+syn keyword cfArg contained height highlighthref hint href hrefkey hscroll hspace html
+syn keyword cfArg contained htmltable id idletimeout img imgopen imgstyle index inline
+syn keyword cfArg contained input insert insertbutton interval isolation italic item
+syn keyword cfArg contained itemcolumn key keyonly label labelformat language list
+syn keyword cfArg contained listgroups locale localfile log loginstorage lookandfeel
+syn keyword cfArg contained mailerid mailto marginbottom marginleft marginright
+syn keyword cfArg contained margintop markersize markerstyle mask max maxlength maxrows
+syn keyword cfArg contained message messagenumber method mimeattach mimetype min mode
+syn keyword cfArg contained modifytype monthnames multipart multiple name nameconflict
+syn keyword cfArg contained namespace new newdirectory notsupported null numberformat
+syn keyword cfArg contained object omit onblur onchange onclick onerror onfocus
+syn keyword cfArg contained onkeydown onkeyup onload onmousedown onmouseup onreset
+syn keyword cfArg contained onsubmit onvalidate operation orderby orientation output
+syn keyword cfArg contained outputfile overwrite ownerpassword pageencoding pageheight
+syn keyword cfArg contained pagetype pagewidth paintstyle param_1 param_2 param_3
+syn keyword cfArg contained param_4 param_5 param_6 param_7 param_8 param_9 parent
+syn keyword cfArg contained parrent passive passthrough password path pattern
+syn keyword cfArg contained permissions picturebar pieslicestyle port porttypename
+syn keyword cfArg contained prefix preloader preservedata previouscriteria procedure
+syn keyword cfArg contained protocol provider providerdsn proxybypass proxypassword
+syn keyword cfArg contained proxyport proxyserver proxyuser publish query queryasroot
+syn keyword cfArg contained queryposition range rebind recurse redirect referral
+syn keyword cfArg contained refreshlabel remotefile replyto report requesttimeout
+syn keyword cfArg contained required reset resoleurl resolveurl result resultset
+syn keyword cfArg contained retrycount returnasbinary returncode returntype
+syn keyword cfArg contained returnvariable roles rotated rowheaderalign rowheaderbold
+syn keyword cfArg contained rowheaderfont rowheaderfontsize rowheaderitalic rowheaders
+syn keyword cfArg contained rowheadertextcolor rowheaderwidth rowheight scale scalefrom
+syn keyword cfArg contained scaleto scope scriptprotect scriptsrc secure securitycontext
+syn keyword cfArg contained select selectcolor selected selecteddate selectedindex
+syn keyword cfArg contained selectmode separator seriescolor serieslabel seriesplacement
+syn keyword cfArg contained server serviceport serviceportname sessionmanagement
+syn keyword cfArg contained sessiontimeout setclientcookies setcookie setdomaincookies
+syn keyword cfArg contained show3d showborder showdebugoutput showerror showlegend
+syn keyword cfArg contained showmarkers showxgridlines showygridlines size skin sort
+syn keyword cfArg contained sortascendingbutton sortcontrol sortdescendingbutton
+syn keyword cfArg contained sortxaxis source spoolenable sql src srcfile start startdate
+syn keyword cfArg contained startrange startrow starttime status statuscode statustext
+syn keyword cfArg contained step stoponerror style subject suggestions
+syn keyword cfArg contained suppresswhitespace tablename tableowner tablequalifier
+syn keyword cfArg contained taglib target task template text textcolor textqualifier
+syn keyword cfArg contained throwonerror throwonerror throwonfailure throwontimeout
+syn keyword cfArg contained timeout timespan tipbgcolor tipstyle title to tooltip
+syn keyword cfArg contained toplevelvariable transfermode type uid unit url urlpath
+syn keyword cfArg contained useragent username userpassword usetimezoneinfo validate
+syn keyword cfArg contained validateat value valuecolumn values valuesdelimiter
+syn keyword cfArg contained valuesdisplay var variable vertical visible vscroll vspace
+syn keyword cfArg contained webservice width wmode wraptext wsdlfile xaxistitle
+syn keyword cfArg contained xaxistype xoffset yaxistitle yaxistype yoffset
-" ColdFusion Functions.
-syn keyword cfFunctionName contained ACos ASin Abs AddSOAPRequestHeader AddSOAPResponseHeader
-syn keyword cfFunctionName contained ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ArrayInsertAt
-syn keyword cfFunctionName contained ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArrayNew
-syn keyword cfFunctionName contained ArrayPrepend ArrayResize ArraySet ArraySort ArraySum
-syn keyword cfFunctionName contained ArraySwap ArrayToList Asc Atn AuthenticatedContext
-syn keyword cfFunctionName contained AuthenticatedUser BinaryDecode BinaryEncode BitAnd
-syn keyword cfFunctionName contained BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN
-syn keyword cfFunctionName contained BitSHRN BitXor CJustify Ceiling CharsetDecode CharsetEncode
-syn keyword cfFunctionName contained Chr Compare CompareNoCase Cos CreateDate CreateDateTime
-syn keyword cfFunctionName contained CreateODBCDate CreateODBCDateTime CreateODBCTime
-syn keyword cfFunctionName contained CreateObject CreateTime CreateTimeSpan CreateUUID DE DateAdd
-syn keyword cfFunctionName contained DateCompare DateConvert DateDiff DateFormat DatePart Day
-syn keyword cfFunctionName contained DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear
-syn keyword cfFunctionName contained DecimalFormat DecrementValue Decrypt DecryptBinary
-syn keyword cfFunctionName contained DeleteClientVariable DirectoryExists DollarFormat Duplicate
-syn keyword cfFunctionName contained Encrypt EncryptBinary Evaluate Exp ExpandPath FileExists
-syn keyword cfFunctionName contained Find FindNoCase FindOneOf FirstDayOfMonth Fix FormatBaseN
-syn keyword cfFunctionName contained GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList
-syn keyword cfFunctionName contained GetBaseTemplatePath GetClientVariablesList GetContextRoot
-syn keyword cfFunctionName contained GetCurrentTemplatePath GetDirectoryFromPath GetEncoding
-syn keyword cfFunctionName contained GetException GetFileFromPath GetFunctionList
-syn keyword cfFunctionName contained GetGatewayHelper GetHttpRequestData GetHttpTimeString
-syn keyword cfFunctionName contained GetLocalHostIP
-syn keyword cfFunctionName contained GetLocale GetLocaleDisplayName GetMetaData GetMetricData
-syn keyword cfFunctionName contained GetPageContext GetProfileSections GetProfileString
-syn keyword cfFunctionName contained GetSOAPRequest GetSOAPRequestHeader GetSOAPResponse
-syn keyword cfFunctionName contained GetSOAPResponseHeader GetTempDirectory GetTempFile
-syn keyword cfFunctionName contained GetTickCount GetTimeZoneInfo GetToken
-syn keyword cfFunctionName contained HTMLCodeFormat HTMLEditFormat Hash Hour IIf IncrementValue
-syn keyword cfFunctionName contained InputBaseN Insert Int IsArray IsAuthenticated IsAuthorized
-syn keyword cfFunctionName contained IsBinary IsBoolean IsCustomFunction IsDate IsDebugMode
-syn keyword cfFunctionName contained IsDefined
-syn keyword cfFunctionName contained IsLeapYear IsLocalHost IsNumeric
-syn keyword cfFunctionName contained IsNumericDate IsObject IsProtected IsQuery IsSOAPRequest
-syn keyword cfFunctionName contained IsSimpleValue IsStruct IsUserInRole IsValid IsWDDX IsXML
-syn keyword cfFunctionName contained IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot
-syn keyword cfFunctionName contained JSStringFormat JavaCast LCase LJustify LSCurrencyFormat
-syn keyword cfFunctionName contained LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate
-syn keyword cfFunctionName contained LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime
-syn keyword cfFunctionName contained LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Left
-syn keyword cfFunctionName contained Len ListAppend ListChangeDelims ListContains
-syn keyword cfFunctionName contained ListContainsNoCase ListDeleteAt ListFind ListFindNoCase
-syn keyword cfFunctionName contained ListFirst ListGetAt ListInsertAt ListLast ListLen
-syn keyword cfFunctionName contained ListPrepend ListQualify ListRest ListSetAt ListSort
-syn keyword cfFunctionName contained ListToArray ListValueCount ListValueCountNoCase Log Log10
-syn keyword cfFunctionName contained Max Mid Min Minute Month MonthAsString Now NumberFormat
-syn keyword cfFunctionName contained ParagraphFormat ParseDateTime Pi
-syn keyword cfFunctionName contained PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow
-syn keyword cfFunctionName contained QueryNew QuerySetCell QuotedValueList REFind REFindNoCase
-syn keyword cfFunctionName contained REReplace REReplaceNoCase RJustify RTrim Rand RandRange
-syn keyword cfFunctionName contained Randomize ReleaseComObject RemoveChars RepeatString Replace
-syn keyword cfFunctionName contained ReplaceList ReplaceNoCase Reverse Right Round Second
-syn keyword cfFunctionName contained SendGatewayMessage SetEncoding SetLocale SetProfileString
-syn keyword cfFunctionName contained SetVariable Sgn Sin SpanExcluding SpanIncluding Sqr StripCR
-syn keyword cfFunctionName contained StructAppend StructClear StructCopy StructCount StructDelete
-syn keyword cfFunctionName contained StructFind StructFindKey StructFindValue StructGet
-syn keyword cfFunctionName contained StructInsert StructIsEmpty StructKeyArray StructKeyExists
-syn keyword cfFunctionName contained StructKeyList StructNew StructSort StructUpdate Tan
-syn keyword cfFunctionName contained TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase
-syn keyword cfFunctionName contained URLDecode URLEncodedFormat URLSessionFormat Val ValueList
-syn keyword cfFunctionName contained Week Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat
-syn keyword cfFunctionName contained XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform
-syn keyword cfFunctionName contained XmlValidate Year YesNoFormat
+" Functions.
+" ColdFusion <=7:
+syn keyword cfFunctionName contained ACos ASin Abs AddSOAPRequestHeader AddSOAPResponseHeader
+syn keyword cfFunctionName contained ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ArrayInsertAt
+syn keyword cfFunctionName contained ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArrayNew
+syn keyword cfFunctionName contained ArrayPrepend ArrayResize ArraySet ArraySort ArraySum
+syn keyword cfFunctionName contained ArraySwap ArrayToList Asc Atn AuthenticatedContext
+syn keyword cfFunctionName contained AuthenticatedUser BinaryDecode BinaryEncode BitAnd
+syn keyword cfFunctionName contained BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN
+syn keyword cfFunctionName contained BitSHRN BitXor CJustify Ceiling CharsetDecode CharsetEncode
+syn keyword cfFunctionName contained Chr Compare CompareNoCase Cos CreateDate CreateDateTime
+syn keyword cfFunctionName contained CreateODBCDate CreateODBCDateTime CreateODBCTime
+syn keyword cfFunctionName contained CreateObject CreateTime CreateTimeSpan CreateUUID DE DateAdd
+syn keyword cfFunctionName contained DateCompare DateConvert DateDiff DateFormat DatePart Day
+syn keyword cfFunctionName contained DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear
+syn keyword cfFunctionName contained DecimalFormat DecrementValue Decrypt DecryptBinary
+syn keyword cfFunctionName contained DeleteClientVariable DirectoryExists DollarFormat Duplicate
+syn keyword cfFunctionName contained Encrypt EncryptBinary Evaluate Exp ExpandPath FileExists
+syn keyword cfFunctionName contained Find FindNoCase FindOneOf FirstDayOfMonth Fix FormatBaseN
+syn keyword cfFunctionName contained GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList
+syn keyword cfFunctionName contained GetBaseTemplatePath GetClientVariablesList GetContextRoot
+syn keyword cfFunctionName contained GetCurrentTemplatePath GetDirectoryFromPath GetEncoding
+syn keyword cfFunctionName contained GetException GetFileFromPath GetFunctionList
+syn keyword cfFunctionName contained GetGatewayHelper GetHttpRequestData GetHttpTimeString
+syn keyword cfFunctionName contained GetLocalHostIP
+syn keyword cfFunctionName contained GetLocale GetLocaleDisplayName GetMetaData GetMetricData
+syn keyword cfFunctionName contained GetPageContext GetProfileSections GetProfileString
+syn keyword cfFunctionName contained GetSOAPRequest GetSOAPRequestHeader GetSOAPResponse
+syn keyword cfFunctionName contained GetSOAPResponseHeader GetTempDirectory GetTempFile
+syn keyword cfFunctionName contained GetTickCount GetTimeZoneInfo GetToken
+syn keyword cfFunctionName contained HTMLCodeFormat HTMLEditFormat Hash Hour IIf IncrementValue
+syn keyword cfFunctionName contained InputBaseN Insert Int IsArray IsAuthenticated IsAuthorized
+syn keyword cfFunctionName contained IsBinary IsBoolean IsCustomFunction IsDate IsDebugMode
+syn keyword cfFunctionName contained IsDefined
+syn keyword cfFunctionName contained IsLeapYear IsLocalHost IsNumeric
+syn keyword cfFunctionName contained IsNumericDate IsObject IsProtected IsQuery IsSOAPRequest
+syn keyword cfFunctionName contained IsSimpleValue IsStruct IsUserInRole IsValid IsWDDX IsXML
+syn keyword cfFunctionName contained IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot
+syn keyword cfFunctionName contained JSStringFormat JavaCast LCase LJustify LSCurrencyFormat
+syn keyword cfFunctionName contained LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate
+syn keyword cfFunctionName contained LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime
+syn keyword cfFunctionName contained LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Left
+syn keyword cfFunctionName contained Len ListAppend ListChangeDelims ListContains
+syn keyword cfFunctionName contained ListContainsNoCase ListDeleteAt ListFind ListFindNoCase
+syn keyword cfFunctionName contained ListFirst ListGetAt ListInsertAt ListLast ListLen
+syn keyword cfFunctionName contained ListPrepend ListQualify ListRest ListSetAt ListSort
+syn keyword cfFunctionName contained ListToArray ListValueCount ListValueCountNoCase Log Log10
+syn keyword cfFunctionName contained Max Mid Min Minute Month MonthAsString Now NumberFormat
+syn keyword cfFunctionName contained ParagraphFormat ParseDateTime Pi
+syn keyword cfFunctionName contained PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow
+syn keyword cfFunctionName contained QueryNew QuerySetCell QuotedValueList REFind REFindNoCase
+syn keyword cfFunctionName contained REReplace REReplaceNoCase RJustify RTrim Rand RandRange
+syn keyword cfFunctionName contained Randomize ReleaseComObject RemoveChars RepeatString Replace
+syn keyword cfFunctionName contained ReplaceList ReplaceNoCase Reverse Right Round Second
+syn keyword cfFunctionName contained SendGatewayMessage SetEncoding SetLocale SetProfileString
+syn keyword cfFunctionName contained SetVariable Sgn Sin SpanExcluding SpanIncluding Sqr StripCR
+syn keyword cfFunctionName contained StructAppend StructClear StructCopy StructCount StructDelete
+syn keyword cfFunctionName contained StructFind StructFindKey StructFindValue StructGet
+syn keyword cfFunctionName contained StructInsert StructIsEmpty StructKeyArray StructKeyExists
+syn keyword cfFunctionName contained StructKeyList StructNew StructSort StructUpdate Tan
+syn keyword cfFunctionName contained TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase
+syn keyword cfFunctionName contained URLDecode URLEncodedFormat URLSessionFormat Val ValueList
+syn keyword cfFunctionName contained Week Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat
+syn keyword cfFunctionName contained XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform
+syn keyword cfFunctionName contained XmlValidate Year YesNoFormat
+" ColdFusion 8:
+syn keyword cfFunctionName contained AjaxLink AjaxOnLoad ArrayIsDefined BinaryDecode BinaryEncode CharsetDecode CharsetEncode
+syn keyword cfFunctionName contained DecryptBinary DeserializeJSON DotNetToCFType EncryptBinary FileClose FileCopy FileDelete
+syn keyword cfFunctionName contained FileIsEOF FileMove FileOpen FileRead FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute
+syn keyword cfFunctionName contained FileSetLastModified FileWrite GenerateSecretKey GetGatewayHelper GetAuthUser GetComponentMetaData
+syn keyword cfFunctionName contained GetContextRoot GetEncoding GetFileInfo GetLocaleDisplayName GetLocalHostIP GetMetaData
+syn keyword cfFunctionName contained GetPageContext GetPrinterInfo GetProfileSections GetReadableImageFormats GetSOAPRequest
+syn keyword cfFunctionName contained GetSOAPRequestHeader GetSOAPResponse GetSOAPResponseHeader GetUserRoles GetWriteableImageFormats
+syn keyword cfFunctionName contained ImageAddBorder ImageBlur ImageClearRect ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect
+syn keyword cfFunctionName contained ImageDrawCubicCurve ImageDrawPoint ImageDrawLine ImageDrawLines ImageDrawOval
+syn keyword cfFunctionName contained ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob
+syn keyword cfFunctionName contained ImageGetBufferedImage ImageGetEXIFMetadata ImageGetEXIFTag ImageGetHeight ImageGetIPTCMetadata
+syn keyword cfFunctionName contained ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay
+syn keyword cfFunctionName contained ImagePaste ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit
+" ColdFusion 9:
+syn keyword cfFunctionName contained ApplicationStop ArrayContains ArrayDelete ArrayFind ArrayFindNoCase IsSpreadsheetFile
+syn keyword cfFunctionName contained IsSpreadsheetObject FileSkipBytes Location ObjectLoad SpreadsheetFormatColumn
+syn keyword cfFunctionName contained SpreadsheetFormatColumns SpreadsheetFormatRow SpreadsheetFormatRows SpreadsheetGetCellComment
+syn keyword cfFunctionName contained CacheGetAllIds CacheGetMetadata CacheGetProperties CacheGet CachePut ObjectSave ORMClearSession
+syn keyword cfFunctionName contained ORMCloseSession ORMEvictQueries ORMEvictCollection SpreadsheetGetCellFormula SpreadsheetGetCellValue
+syn keyword cfFunctionName contained SpreadsheetInfo SpreadsheetMergeCells SpreadsheetNew CacheRemove CacheSetProperties DirectoryCreate
+syn keyword cfFunctionName contained DirectoryDelete DirectoryExists ORMEvictEntity ORMEvictQueries ORMExecuteQuery ORMFlush
+syn keyword cfFunctionName contained ORMGetSession SpreadsheetRead SpreadsheetReadBinary SpreadsheetSetActiveSheetNumber
+syn keyword cfFunctionName contained SpreadsheetSetCellComment SpreadsheetSetCellFormula DirectoryList DirectoryRename EntityDelete
+syn keyword cfFunctionName contained EntityLoad EntityLoadByExample ORMGetSessionFactory ORMReload ObjectEquals SpreadsheetAddColumn
+syn keyword cfFunctionName contained SpreadsheetAddFreezePane SpreadsheetSetCellValue SpreadsheetSetActiveSheet SpreadsheetSetFooter
+syn keyword cfFunctionName contained SpreadsheetSetHeader SpreadsheetSetColumnWidth EntityLoadByPK EntityMerge EntityNew EntityReload
+syn keyword cfFunctionName contained EntitySave SpreadsheetAddImage SpreadsheetAddInfo SpreadsheetAddRow SpreadsheetAddRows
+syn keyword cfFunctionName contained SpreadsheetAddSplitPane SpreadsheetShiftColumns SpreadsheetShiftRows SpreadsheetSetRowHeight
+syn keyword cfFunctionName contained SpreadsheetWrite Trace FileDelete FileSeek FileWriteLine GetFunctionCalledName GetVFSMetaData IsIPv6
+syn keyword cfFunctionName contained IsNull SpreadsheetCreateSheet SpreadsheetDeleteColumn SpreadsheetDeleteColumns SpreadsheetDeleteRow
+syn keyword cfFunctionName contained SpreadsheetDeleteRows SpreadsheetFormatCell TransactionCommit TransactionRollback
+syn keyword cfFunctionName contained TransactionSetSavePoint ThreadTerminate ThreadJoin Throw Writedump Writelog
-" Deprecated tags and functions.
-syn keyword cfDeprecated contained cfauthenticate cfimpersonate cfgraph cfgraphdata
-syn keyword cfDeprecated contained cfservlet cfservletparam cftextinput
-syn keyword cfDeprecated contained GetK2ServerDocCount GetK2ServerDocCountLimit GetTemplatePath
-syn keyword cfDeprecated contained IsK2ServerABroker IsK2ServerDocCountExceeded IsK2ServerOnline
-syn keyword cfDeprecated contained ParameterExists
+" Deprecated or obsoleted tags and functions.
+syn keyword cfDeprecatedTag contained cfauthenticate cfimpersonate cfgraph cfgraphdata
+syn keyword cfDeprecatedTag contained cfservlet cfservletparam cftextinput
+syn keyword cfDeprecatedTag contained cfinternaladminsecurity cfnewinternaladminsecurity
+syn keyword cfDeprecatedFunction contained GetK2ServerDocCount GetK2ServerDocCountLimit GetTemplatePath
+syn keyword cfDeprecatedFunction contained IsK2ServerABroker IsK2ServerDocCountExceeded IsK2ServerOnline
+syn keyword cfDeprecatedFunction contained ParameterExists AuthenticatedContext AuthenticatedUser
+syn keyword cfDeprecatedFunction contained isAuthenticated isAuthorized isProtected
-syn cluster htmlTagNameCluster add=cfTagName
-syn cluster htmlArgCluster add=cfArg,cfHashRegion,cfScope
-syn cluster htmlPreproc add=cfHashRegion
+" Add to the HTML clusters.
+syn cluster htmlTagNameCluster add=cfTagName,cfCustomTagName,cfDeprecatedTag
+syn cluster htmlArgCluster add=cfArg,cfHashRegion,cfScope
+syn cluster htmlPreproc add=cfHashRegion
-syn cluster cfExpressionCluster contains=cfFunctionName,cfScope,@cfOperatorCluster,cfScriptStringD,cfScriptStringS,cfScriptNumber,cfBool
+syn cluster cfExpressionCluster contains=cfFunctionName,cfScope,@cfOperatorCluster,cfScriptStringD,cfScriptStringS,cfScriptNumber,cfBool,cfComment
" Evaluation; skip strings ( this helps with cases like nested IIf() )
-syn region cfHashRegion start=+#+ skip=+"[^"]*"\|'[^']*'+ end=+#+ contains=@cfExpressionCluster,cfScriptParenError
+" containedin to add to the TOP of cfOutputRegion.
+syn region cfHashRegion start=+#+ skip=+"[^"]*"\|'[^']*'+ end=+#+ contained containedin=cfOutputRegion contains=@cfExpressionCluster,cfScriptParenError
+
+" Hashmarks are significant inside cfoutput tags.
+" cfoutput tags may be nested indefinitely.
+syn region cfOutputRegion matchgroup=NONE transparent start=+<cfoutput>+ end=+</cfoutput>+ contains=TOP
" <cfset>, <cfif>, <cfelseif>, <cfreturn> are analogous to hashmarks (implicit
" evaluation) and have 'var'
-syn region cfSetRegion start="<cfset " start="<cfreturn " start="<cfelseif " start="<cfif " end='>' keepend contains=@cfExpressionCluster,cfSetLHSRegion,cfSetTagEnd,cfScriptType
-syn region cfSetLHSRegion contained start="<cfreturn" start="<cfelseif" start="<cfif" start="<cfset" end=" " keepend contains=cfTagName,htmlTag
-syn match cfSetTagEnd contained '>'
+syn region cfSetRegion start="<cfset\>" start="<cfreturn\>" start="<cfelseif\>" start="<cfif\>" end='>' keepend contains=@cfExpressionCluster,cfSetLHSRegion,cfSetTagEnd,cfScriptStatement
+syn region cfSetLHSRegion contained start="<cfreturn" start="<cfelseif" start="<cfif" start="<cfset" end="." keepend contains=cfTagName,htmlTag
+syn match cfSetTagEnd contained '>'
-" CF comments: similar to SGML comments
-syn region cfComment start='<!---' end='--->' keepend contains=cfCommentTodo
-syn keyword cfCommentTodo contained TODO FIXME XXX TBD WTF
+" CF comments: similar to SGML comments, but can be nested.
+syn region cfComment start='<!---' end='--->' contains=cfCommentTodo,cfComment
+syn keyword cfCommentTodo contained TODO FIXME XXX TBD WTF
" CFscript
-syn match cfScriptLineComment contained "\/\/.*$" contains=cfCommentTodo
-syn region cfScriptComment contained start="/\*" end="\*/" contains=cfCommentTodo
+" TODO better support for new component/function def syntax
+" TODO better support for 'new'
+" TODO highlight metadata (@ ...) inside comments.
+syn match cfScriptLineComment contained "\/\/.*$" contains=cfCommentTodo
+syn region cfScriptComment contained start="/\*" end="\*/" contains=cfCommentTodo
+syn match cfScriptBraces contained "[{}]"
+syn keyword cfScriptStatement contained return var
" in CF, quotes are escaped by doubling
-syn region cfScriptStringD contained start=+"+ skip=+\\\\\|""+ end=+"+ extend contains=@htmlPreproc,cfHashRegion
-syn region cfScriptStringS contained start=+'+ skip=+\\\\\|''+ end=+'+ extend contains=@htmlPreproc,cfHashRegion
-syn match cfScriptNumber contained "\<\d\+\>"
-syn keyword cfScriptConditional contained if else
-syn keyword cfScriptRepeat contained while for in
-syn keyword cfScriptBranch contained break switch case default try catch continue
-syn keyword cfScriptFunction contained function
-syn keyword cfScriptType contained var
-syn match cfScriptBraces contained "[{}]"
-syn keyword cfScriptStatement contained return
+syn region cfScriptStringD contained start=+"+ skip=+\\\\\|""+ end=+"+ extend contains=@htmlPreproc,cfHashRegion
+syn region cfScriptStringS contained start=+'+ skip=+\\\\\|''+ end=+'+ extend contains=@htmlPreproc,cfHashRegion
+syn match cfScriptNumber contained "\<\d\+\>"
+syn keyword cfScriptConditional contained if else
+syn keyword cfScriptRepeat contained while for in
+syn keyword cfScriptBranch contained break switch case default try catch continue finally
+syn keyword cfScriptKeyword contained function
+" argumentCollection is a special argument to function calls
+syn keyword cfScriptSpecial contained argumentcollection
+" ColdFusion 9:
+syn keyword cfScriptStatement contained new import
+" CFscript equivalents of some tags
+syn keyword cfScriptKeyword contained abort component exit import include
+syn keyword cfScriptKeyword contained interface param pageencoding property rethrow thread transaction
+" function/component syntax
+syn keyword cfScriptSpecial contained required extends
-syn cluster cfScriptCluster contains=cfScriptParen,cfScriptLineComment,cfScriptComment,cfScriptStringD,cfScriptStringS,cfScriptFunction,cfScriptNumber,cfScriptRegexpString,cfScriptBoolean,cfScriptBraces,cfHashRegion,cfFunctionName,cfScope,@cfOperatorCluster,cfScriptConditional,cfScriptRepeat,cfScriptBranch,cfScriptType,@cfExpressionCluster,cfScriptStatement
+
+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
" Errors caused by wrong parenthesis; skip strings
-syn region cfScriptParen contained transparent skip=+"[^"]*"\|'[^']*'+ start=+(+ end=+)+ contains=@cfScriptCluster
-syn match cfScrParenError contained +)+
+syn region cfScriptParen contained transparent skip=+"[^"]*"\|'[^']*'+ start=+(+ end=+)+ contains=@cfScriptCluster
+syn match cfScrParenError contained +)+
-syn region cfscriptBlock matchgroup=NONE start="<cfscript>" end="<\/cfscript>"me=s-1 keepend contains=@cfScriptCluster,cfscriptTag,cfScrParenError
-syn region cfscriptTag contained start='<cfscript' end='>' keepend contains=cfTagName,htmlTag
+syn region cfscriptBlock matchgroup=NONE start="<cfscript>" end="<\/cfscript>"me=s-1 keepend contains=@cfScriptCluster,cfscriptTag,cfScrParenError
+syn region cfscriptTag contained start='<cfscript' end='>' keepend contains=cfTagName,htmlTag
" CFML
-syn cluster cfmlCluster contains=cfComment,@htmlTagNameCluster,@htmlPreproc,cfSetRegion,cfscriptBlock
+syn cluster cfmlCluster contains=cfComment,@htmlTagNameCluster,@htmlPreproc,cfSetRegion,cfscriptBlock,cfOutputRegion
-" cfquery = sql
-unlet b:current_syntax
-syn include @cfSql <sfile>:p:h/sql.vim
-unlet b:current_syntax
-syn region cfqueryTag contained start=+<cfquery+ end=+>+ keepend contains=cfTagName,htmlTag
-syn region cfSqlregion start=+<cfquery[^>]*>+ keepend end=+<\/cfquery>+me=s-1 matchgroup=NONE contains=@cfSql,cfComment,@htmlTagNameCluster,cfqueryTag
-
-" Define the default highlighting.
-if version >= 508 || !exists("did_cf_syn_inits")
- if version < 508
- let did_cf_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink cfTagName Statement
- HiLink cfArg Type
- HiLink cfFunctionName Function
- HiLink cfHashRegion PreProc
- HiLink cfComment Comment
- HiLink cfCommentTodo Todo
- HiLink cfOperator Operator
- HiLink cfOperatorMatch Operator
- HiLink cfScope Title
- HiLink cfBool Constant
-
- HiLink cfscriptBlock Special
- HiLink cfscriptTag htmlTag
- HiLink cfSetRegion PreProc
- HiLink cfSetLHSRegion htmlTag
- HiLink cfSetTagEnd htmlTag
-
- HiLink cfScriptLineComment Comment
- HiLink cfScriptComment Comment
- HiLink cfScriptStringS String
- HiLink cfScriptStringD String
- HiLink cfScriptNumber cfScriptValue
- HiLink cfScriptConditional Conditional
- HiLink cfScriptRepeat Repeat
- HiLink cfScriptBranch Conditional
- HiLink cfScriptType Type
- HiLink cfScriptStatement Statement
- HiLink cfScriptBraces Function
- HiLink cfScriptFunction Function
- HiLink cfScriptError Error
- HiLink cfDeprecated Error
- HiLink cfScrParenError cfScriptError
-
- HiLink cfqueryTag htmlTag
-
- delcommand HiLink
+" cfquery = sql syntax
+if exists("b:current_syntax")
+ unlet b:current_syntax
endif
+syn include @cfSql $VIMRUNTIME/syntax/sql.vim
+unlet b:current_syntax
+syn region cfqueryTag contained start=+<cfquery+ end=+>+ keepend contains=cfTagName,htmlTag
+syn region cfSqlregion start=+<cfquery\_[^>]*>+ keepend end=+</cfquery>+me=s-1 matchgroup=NONE contains=@cfSql,cfComment,@htmlTagNameCluster,cfqueryTag,cfHashRegion
+
+" Define the highlighting.
+command -nargs=+ CfHiLink hi def link <args>
+
+if exists("d_noinclude_html")
+ " The default html-style highlighting copied from html.vim.
+ CfHiLink htmlTag Function
+ CfHiLink htmlEndTag Identifier
+ CfHiLink htmlArg Type
+ CfHiLink htmlTagName htmlStatement
+ CfHiLink htmlValue String
+ CfHiLink htmlPreProc PreProc
+ CfHiLink htmlString String
+ CfHiLink htmlStatement Statement
+ CfHiLink htmlValue String
+ CfHiLink htmlTagError htmlError
+ CfHiLink htmlError Error
+endif
+
+CfHiLink cfTagName Statement
+CfHiLink cfCustomTagName Statement
+CfHiLink cfArg Type
+CfHiLink cfFunctionName Function
+CfHiLink cfHashRegion PreProc
+CfHiLink cfComment Comment
+CfHiLink cfCommentTodo Todo
+CfHiLink cfOperator Operator
+CfHiLink cfOperatorMatch Operator
+CfHiLink cfScope Title
+CfHiLink cfBool Constant
+
+CfHiLink cfscriptBlock Special
+CfHiLink cfscriptTag htmlTag
+CfHiLink cfSetRegion PreProc
+CfHiLink cfSetLHSRegion htmlTag
+CfHiLink cfSetTagEnd htmlTag
+
+CfHiLink cfScriptLineComment Comment
+CfHiLink cfScriptComment Comment
+CfHiLink cfScriptStringS String
+CfHiLink cfScriptStringD String
+CfHiLink cfScriptNumber cfScriptValue
+CfHiLink cfScriptConditional Conditional
+CfHiLink cfScriptRepeat Repeat
+CfHiLink cfScriptBranch Conditional
+CfHiLink cfScriptSpecial Type
+CfHiLink cfScriptStatement Statement
+CfHiLink cfScriptBraces Function
+CfHiLink cfScriptKeyword Function
+CfHiLink cfScriptError Error
+CfHiLink cfDeprecatedTag Error
+CfHiLink cfDeprecatedFunction Error
+CfHiLink cfScrParenError cfScriptError
+
+CfHiLink cfqueryTag htmlTag
+
+delcommand CfHiLink
let b:current_syntax = "cf"
-" vim: ts=8 sw=2
+" vim: nowrap sw=2 ts=8 noet
diff --git a/runtime/syntax/cucumber.vim b/runtime/syntax/cucumber.vim
new file mode 100644
index 0000000..258471a
--- /dev/null
+++ b/runtime/syntax/cucumber.vim
@@ -0,0 +1,117 @@
+" Vim syntax file
+" Language: Cucumber
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Filenames: *.feature
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+syn sync minlines=20
+
+let g:cucumber_languages = {
+ \"en": {"and": "And\\>", "background": "Background\\>", "but": "But\\>", "examples": "Scenarios\\>\\|Examples\\>", "feature": "Feature\\>", "given": "Given\\>", "scenario": "Scenario\\>", "scenario_outline": "Scenario Outline\\>", "then": "Then\\>", "when": "When\\>"},
+ \"ar": {"and": "\\%u0648\\>", "background": "\\%u0627\\%u0644\\%u062e\\%u0644\\%u0641\\%u064a\\%u0629\\>", "but": "\\%u0644\\%u0643\\%u0646\\>", "examples": "\\%u0627\\%u0645\\%u062b\\%u0644\\%u0629\\>", "feature": "\\%u062e\\%u0627\\%u0635\\%u064a\\%u0629\\>", "given": "\\%u0628\\%u0641\\%u0631\\%u0636\\>", "scenario": "\\%u0633\\%u064a\\%u0646\\%u0627\\%u0631\\%u064a\\%u0648\\>", "scenario_outline": "\\%u0633\\%u064a\\%u0646\\%u0627\\%u0631\\%u064a\\%u0648 \\%u0645\\%u062e\\%u0637\\%u0637\\>", "then": "\\%u0627\\%u0630\\%u0627\\%u064b\\>\\|\\%u062b\\%u0645\\>", "when": "\\%u0639\\%u0646\\%u062f\\%u0645\\%u0627\\>\\|\\%u0645\\%u062a\\%u0649\\>"},
+ \"bg": {"and": "\\%u0418\\>", "background": "\\%u041f\\%u0440\\%u0435\\%u0434\\%u0438\\%u0441\\%u0442\\%u043e\\%u0440\\%u0438\\%u044f\\>", "but": "\\%u041d\\%u043e\\>", "examples": "\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\%u043d\\%u043e\\%u0441\\%u0442\\>", "given": "\\%u0414\\%u0430\\%u0434\\%u0435\\%u043d\\%u043e\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0420\\%u0430\\%u043c\\%u043a\\%u0430 \\%u043d\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "then": "\\%u0422\\%u043e\\>", "when": "\\%u041a\\%u043e\\%u0433\\%u0430\\%u0442\\%u043e\\>"},
+ \"cat": {"and": "I\\>", "background": "Antecedents\\>\\|Rerefons\\>", "but": "Per\\%u00f2\\>", "examples": "Exemples\\>", "feature": "Caracter\\%u00edstica\\>", "given": "Donada\\>\\|Donat\\>", "scenario": "Escenari\\>", "scenario_outline": "Esquema de l'escenari\\>", "then": "Aleshores\\>", "when": "Quan\\>"},
+ \"cs": {"and": "A tak\\%u00e9\\>\\|A\\>", "background": "Pozad\\%u00ed\\>\\|Kontext\\>", "but": "Ale\\>", "examples": "P\\%u0159\\%u00edklady\\>", "feature": "Po\\%u017eadavek\\>", "given": "Pokud\\>", "scenario": "Sc\\%u00e9n\\%u00e1\\%u0159\\>", "scenario_outline": "N\\%u00e1\\%u010drt Sc\\%u00e9n\\%u00e1\\%u0159e\\>\\|Osnova sc\\%u00e9n\\%u00e1\\%u0159e\\>", "then": "Pak\\>", "when": "Kdy\\%u017e\\>"},
+ \"cy": {"and": "A\\>", "background": "Cefndir\\>", "but": "Ond\\>", "examples": "Enghreifftiau\\>", "feature": "Arwedd\\>", "given": "anrhegedig a\\>", "scenario": "Scenario\\>", "scenario_outline": "Scenario Amlinellol\\>", "then": "Yna\\>", "when": "Pryd\\>"},
+ \"da": {"and": "Og\\>", "background": "Baggrund\\>", "but": "Men\\>", "examples": "Eksempler\\>", "feature": "Egenskab\\>", "given": "Givet\\>", "scenario": "Scenarie\\>", "scenario_outline": "Abstrakt Scenario\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e5r\\>"},
+ \"de": {"and": "Und\\>", "background": "Grundlage\\>", "but": "Aber\\>", "examples": "Beispiele\\>", "feature": "Funktionalit\\%u00e4t\\>", "given": "Gegeben sei\\>", "scenario": "Szenario\\>", "scenario_outline": "Szenariogrundriss\\>", "then": "Dann\\>", "when": "Wenn\\>"},
+ \"en-au": {"and": "N\\>", "background": "Background\\>", "but": "Cept\\>", "examples": "Cobber\\>", "feature": "Crikey\\>", "given": "Ya know how\\>", "scenario": "Mate\\>", "scenario_outline": "Blokes\\>", "then": "Ya gotta\\>", "when": "When\\>"},
+ \"en-lol": {"and": "AN\\>", "background": "B4\\>", "but": "BUT\\>", "examples": "EXAMPLZ\\>", "feature": "OH HAI\\>", "given": "I CAN HAZ\\>", "scenario": "MISHUN\\>", "scenario_outline": "MISHUN SRSLY\\>", "then": "DEN\\>", "when": "WEN\\>"},
+ \"es": {"and": "Y\\>", "background": "Antecedentes\\>", "but": "Pero\\>", "examples": "Ejemplos\\>", "feature": "Caracter\\%u00edstica\\>", "given": "Dado\\>", "scenario": "Escenario\\>", "scenario_outline": "Esquema del escenario\\>", "then": "Entonces\\>", "when": "Cuando\\>"},
+ \"et": {"and": "Ja\\>", "background": "Taust\\>", "but": "Kuid\\>", "examples": "Juhtumid\\>", "feature": "Omadus\\>", "given": "Eeldades\\>", "scenario": "Stsenaarium\\>", "scenario_outline": "Raamstsenaarium\\>", "then": "Siis\\>", "when": "Kui\\>"},
+ \"fi": {"and": "Ja\\>", "background": "Tausta\\>", "but": "Mutta\\>", "examples": "Tapaukset\\>", "feature": "Ominaisuus\\>", "given": "Oletetaan\\>", "scenario": "Tapaus\\>", "scenario_outline": "Tapausaihio\\>", "then": "Niin\\>", "when": "Kun\\>"},
+ \"fr": {"and": "Et\\>", "background": "Contexte\\>", "but": "Mais\\>", "examples": "Exemples\\>", "feature": "Fonctionnalit\\%u00e9\\>", "given": "Etant donn\\%u00e9\\>\\|Soit\\>", "scenario": "Sc\\%u00e9nario\\>", "scenario_outline": "Plan du sc\\%u00e9nario\\>\\|Plan du Sc\\%u00e9nario\\>", "then": "Alors\\>", "when": "Lorsqu'\\|Lorsque\\>\\|Quand\\>"},
+ \"he": {"and": "\\%u05d5\\%u05d2\\%u05dd\\>", "background": "\\%u05e8\\%u05e7\\%u05e2\\>", "but": "\\%u05d0\\%u05d1\\%u05dc\\>", "examples": "\\%u05d3\\%u05d5\\%u05d2\\%u05de\\%u05d0\\%u05d5\\%u05ea\\>", "feature": "\\%u05ea\\%u05db\\%u05d5\\%u05e0\\%u05d4\\>", "given": "\\%u05d1\\%u05d4\\%u05d9\\%u05e0\\%u05ea\\%u05df\\>", "scenario": "\\%u05ea\\%u05e8\\%u05d7\\%u05d9\\%u05e9\\>", "scenario_outline": "\\%u05ea\\%u05d1\\%u05e0\\%u05d9\\%u05ea \\%u05ea\\%u05e8\\%u05d7\\%u05d9\\%u05e9\\>", "then": "\\%u05d0\\%u05d6\\%u05d9\\>\\|\\%u05d0\\%u05d6\\>", "when": "\\%u05db\\%u05d0\\%u05e9\\%u05e8\\>"},
+ \"hr": {"and": "I\\>", "background": "Pozadina\\>", "but": "Ali\\>", "examples": "Scenariji\\>\\|Primjeri\\>", "feature": "Mogu\\%u0107nost\\>\\|Mogucnost\\>\\|Osobina\\>", "given": "Zadano\\>\\|Zadani\\>\\|Zadan\\>", "scenario": "Scenarij\\>", "scenario_outline": "Koncept\\>\\|Skica\\>", "then": "Onda\\>", "when": "Kada\\>\\|Kad\\>"},
+ \"hu": {"and": "\\%u00c9s\\>", "background": "H\\%u00e1tt\\%u00e9r\\>", "but": "De\\>", "examples": "P\\%u00e9ld\\%u00e1k\\>", "feature": "Jellemz\\%u0151\\>", "given": "Ha\\>", "scenario": "Forgat\\%u00f3k\\%u00f6nyv\\>", "scenario_outline": "Forgat\\%u00f3k\\%u00f6nyv v\\%u00e1zlat\\>", "then": "Akkor\\>", "when": "Majd\\>"},
+ \"id": {"and": "Dan\\>", "background": "Dasar\\>", "but": "Tapi\\>", "examples": "Contoh\\>", "feature": "Fitur\\>", "given": "Dengan\\>", "scenario": "Skenario\\>", "scenario_outline": "Skenario konsep\\>", "then": "Maka\\>", "when": "Ketika\\>"},
+ \"it": {"and": "E\\>", "background": "Contesto\\>", "but": "Ma\\>", "examples": "Esempi\\>", "feature": "Funzionalit\\%u00e0\\>", "given": "Dato\\>", "scenario": "Scenario\\>", "scenario_outline": "Schema dello scenario\\>", "then": "Allora\\>", "when": "Quando\\>"},
+ \"ja": {"and": "\\%u304b\\%u3064", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u3057\\%u304b\\%u3057\\|\\%u305f\\%u3060\\%u3057\\|\\%u4f46\\%u3057", "examples": "\\%u30b5\\%u30f3\\%u30d7\\%u30eb\\>\\|\\%u4f8b\\>", "feature": "\\%u30d5\\%u30a3\\%u30fc\\%u30c1\\%u30e3\\>\\|\\%u6a5f\\%u80fd\\>", "given": "\\%u524d\\%u63d0", "scenario": "\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\>", "scenario_outline": "\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30a2\\%u30a6\\%u30c8\\%u30e9\\%u30a4\\%u30f3\\>\\|\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\%u30fc\\%u30c8\\>\\|\\%u30b7\\%u30ca\\%u30ea\\%u30aa\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\>\\|\\%u30c6\\%u30f3\\%u30d7\\%u30ec\\>", "then": "\\%u306a\\%u3089\\%u3070", "when": "\\%u3082\\%u3057"},
+ \"ko": {"and": "\\%uadf8\\%ub9ac\\%uace0", "background": "\\%ubc30\\%uacbd\\>", "but": "\\%ud558\\%uc9c0\\%ub9cc", "examples": "\\%uc608\\>", "feature": "\\%uae30\\%ub2a5\\>", "given": "\\%uc870\\%uac74", "scenario": "\\%uc2dc\\%ub098\\%ub9ac\\%uc624\\>", "scenario_outline": "\\%uc2dc\\%ub098\\%ub9ac\\%uc624 \\%uac1c\\%uc694\\>", "then": "\\%uadf8\\%ub7ec\\%uba74", "when": "\\%ub9cc\\%uc77c"},
+ \"lt": {"and": "Ir\\>", "background": "Kontekstas\\>", "but": "Bet\\>", "examples": "Pavyzd\\%u017eiai\\>\\|Scenarijai\\>\\|Variantai\\>", "feature": "Savyb\\%u0117\\>", "given": "Duota\\>", "scenario": "Scenarijus\\>", "scenario_outline": "Scenarijaus \\%u0161ablonas\\>", "then": "Tada\\>", "when": "Kai\\>"},
+ \"lv": {"and": "Un\\>", "background": "Situ\\%u0101cija\\>\\|Konteksts\\>", "but": "Bet\\>", "examples": "Piem\\%u0113ri\\>\\|Paraugs\\>", "feature": "Funkcionalit\\%u0101te\\>\\|F\\%u012b\\%u010da\\>", "given": "Kad\\>", "scenario": "Scen\\%u0101rijs\\>", "scenario_outline": "Scen\\%u0101rijs p\\%u0113c parauga\\>", "then": "Tad\\>", "when": "Ja\\>"},
+ \"nl": {"and": "En\\>", "background": "Achtergrond\\>", "but": "Maar\\>", "examples": "Voorbeelden\\>", "feature": "Functionaliteit\\>", "given": "Gegeven\\>\\|Stel\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstract Scenario\\>", "then": "Dan\\>", "when": "Als\\>"},
+ \"no": {"and": "Og\\>", "background": "Bakgrunn\\>", "but": "Men\\>", "examples": "Eksempler\\>", "feature": "Egenskap\\>", "given": "Gitt\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstrakt Scenario\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e5r\\>"},
+ \"pl": {"and": "Oraz\\>", "background": "Za\\%u0142o\\%u017cenia\\>", "but": "Ale\\>", "examples": "Przyk\\%u0142ady\\>", "feature": "W\\%u0142a\\%u015bciwo\\%u015b\\%u0107\\>", "given": "Zak\\%u0142adaj\\%u0105c\\>", "scenario": "Scenariusz\\>", "scenario_outline": "Szablon scenariusza\\>", "then": "Wtedy\\>", "when": "Je\\%u017celi\\>"},
+ \"pt": {"and": "E\\>", "background": "Contexto\\>", "but": "Mas\\>", "examples": "Exemplos\\>", "feature": "Funcionalidade\\>", "given": "Dado\\>", "scenario": "Cen\\%u00e1rio\\>\\|Cenario\\>", "scenario_outline": "Esquema do Cen\\%u00e1rio\\>\\|Esquema do Cenario\\>", "then": "Ent\\%u00e3o\\>\\|Entao\\>", "when": "Quando\\>"},
+ \"ro": {"and": "Si\\>", "background": "Conditii\\>", "but": "Dar\\>", "examples": "Exemplele\\>", "feature": "Functionalitate\\>", "given": "Daca\\>", "scenario": "Scenariu\\>", "scenario_outline": "Scenariul de sablon\\>", "then": "Atunci\\>", "when": "Cand\\>"},
+ \"ro2": {"and": "\\%u0218i\\>", "background": "Condi\\%u0163ii\\>", "but": "Dar\\>", "examples": "Exemplele\\>", "feature": "Func\\%u021bionalitate\\>", "given": "Dac\\%u0103\\>", "scenario": "Scenariu\\>", "scenario_outline": "Scenariul de \\%u015fablon\\>", "then": "Atunci\\>", "when": "C\\%u00e2nd\\>"},
+ \"ru": {"and": "\\%u041a \\%u0442\\%u043e\\%u043c\\%u0443 \\%u0436\\%u0435\\>\\|\\%u0418\\>", "background": "\\%u041f\\%u0440\\%u0435\\%u0434\\%u044b\\%u0441\\%u0442\\%u043e\\%u0440\\%u0438\\%u044f\\>", "but": "\\%u041d\\%u043e\\>\\|\\%u0410\\>", "examples": "\\%u0417\\%u043d\\%u0430\\%u0447\\%u0435\\%u043d\\%u0438\\%u044f\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\>", "given": "\\%u0414\\%u043e\\%u043f\\%u0443\\%u0441\\%u0442\\%u0438\\%u043c\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u044f\\>", "then": "\\%u0422\\%u043e\\>", "when": "\\%u0415\\%u0441\\%u043b\\%u0438\\>"},
+ \"se": {"and": "Och\\>", "background": "Bakgrund\\>", "but": "Men\\>", "examples": "Exempel\\>", "feature": "Egenskap\\>", "given": "Givet\\>", "scenario": "Scenario\\>", "scenario_outline": "Abstrakt Scenario\\>", "then": "S\\%u00e5\\>", "when": "N\\%u00e4r\\>"},
+ \"sk": {"and": "A\\>", "background": "Pozadie\\>", "but": "Ale\\>", "examples": "Pr\\%u00edklady\\>", "feature": "Po\\%u017eiadavka\\>", "given": "Pokia\\%u013e\\>", "scenario": "Scen\\%u00e1r\\>", "scenario_outline": "N\\%u00e1\\%u010drt Scen\\%u00e1ru\\>", "then": "Tak\\>", "when": "Ke\\%u010f\\>"},
+ \"sr": {"and": "\\%u0418\\>", "background": "\\%u041a\\%u043e\\%u043d\\%u0442\\%u0435\\%u043a\\%u0441\\%u0442\\>\\|\\%u041f\\%u043e\\%u0437\\%u0430\\%u0434\\%u0438\\%u043d\\%u0430\\>\\|\\%u041e\\%u0441\\%u043d\\%u043e\\%u0432\\%u0430\\>", "but": "\\%u0410\\%u043b\\%u0438\\>", "examples": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0458\\%u0438\\>\\|\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\%u0438\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\%u043d\\%u043e\\%u0441\\%u0442\\>\\|\\%u041c\\%u043e\\%u0433\\%u0443\\%u045b\\%u043d\\%u043e\\%u0441\\%u0442\\>\\|\\%u041e\\%u0441\\%u043e\\%u0431\\%u0438\\%u043d\\%u0430\\>", "given": "\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u043e\\>\\|\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u0435\\>\\|\\%u0417\\%u0430\\%u0434\\%u0430\\%u0442\\%u0438\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u043e\\>\\|\\%u041f\\%u0440\\%u0438\\%u043c\\%u0435\\%u0440\\>", "scenario_outline": "\\%u0421\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430 \\%u0441\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0458\\%u0430\\>\\|\\%u041a\\%u043e\\%u043d\\%u0446\\%u0435\\%u043f\\%u0442\\>\\|\\%u0421\\%u043a\\%u0438\\%u0446\\%u0430\\>", "then": "\\%u041e\\%u043d\\%u0434\\%u0430\\>", "when": "\\%u041a\\%u0430\\%u0434\\%u0430\\>\\|\\%u041a\\%u0430\\%u0434\\>"},
+ \"sr-Latn": {"and": "I\\>", "background": "Kontekst\\>\\|Pozadina\\>\\|Osnova\\>", "but": "Ali\\>", "examples": "Scenariji\\>\\|Primeri\\>", "feature": "Mogu\\%u0107nost\\>\\|Funkcionalnost\\>\\|Mogucnost\\>\\|Osobina\\>", "given": "Zadato\\>\\|Zadate\\>\\|Zatati\\>", "scenario": "Scenario\\>\\|Primer\\>", "scenario_outline": "Struktura scenarija\\>\\|Koncept\\>\\|Skica\\>", "then": "Onda\\>", "when": "Kada\\>\\|Kad\\>"},
+ \"tr": {"and": "Ve\\>", "background": "Ge\\%u00e7mi\\%u015f\\>", "but": "Fakat\\>\\|Ama\\>", "examples": "\\%u00d6rnekler\\>", "feature": "\\%u00d6zellik\\>", "given": "Diyelim ki\\>", "scenario": "Senaryo\\>", "scenario_outline": "Senaryo tasla\\%u011f\\%u0131\\>", "then": "O zaman\\>", "when": "E\\%u011fer ki\\>"},
+ \"uz": {"and": "\\%u0412\\%u0430\\>", "background": "\\%u0422\\%u0430\\%u0440\\%u0438\\%u0445\\>", "but": "\\%u041b\\%u0435\\%u043a\\%u0438\\%u043d\\>\\|\\%u0411\\%u0438\\%u0440\\%u043e\\%u043a\\>\\|\\%u0410\\%u043c\\%u043c\\%u043e\\>", "examples": "\\%u041c\\%u0438\\%u0441\\%u043e\\%u043b\\%u043b\\%u0430\\%u0440\\>", "feature": "\\%u0424\\%u0443\\%u043d\\%u043a\\%u0446\\%u0438\\%u043e\\%u043d\\%u0430\\%u043b\\>", "given": "\\%u0410\\%u0433\\%u0430\\%u0440\\>", "scenario": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439\\>", "scenario_outline": "\\%u0421\\%u0446\\%u0435\\%u043d\\%u0430\\%u0440\\%u0438\\%u0439 \\%u0441\\%u0442\\%u0440\\%u0443\\%u043a\\%u0442\\%u0443\\%u0440\\%u0430\\%u0441\\%u0438\\>", "then": "\\%u0423\\%u043d\\%u0434\\%u0430\\>", "when": "\\%u0410\\%u0433\\%u0430\\%u0440\\>"},
+ \"vi": {"and": "V\\%u00e0\\>", "background": "B\\%u1ed1i c\\%u1ea3nh\\>", "but": "Nh\\%u01b0ng\\>", "examples": "D\\%u1eef li\\%u1ec7u\\>", "feature": "T\\%u00ednh n\\%u0103ng\\>", "given": "Bi\\%u1ebft\\>\\|Cho\\>", "scenario": "T\\%u00ecnh hu\\%u1ed1ng\\>\\|K\\%u1ecbch b\\%u1ea3n\\>", "scenario_outline": "Khung t\\%u00ecnh hu\\%u1ed1ng\\>\\|Khung k\\%u1ecbch b\\%u1ea3n\\>", "then": "Th\\%u00ec\\>", "when": "Khi\\>"},
+ \"zh-CN": {"and": "\\%u800c\\%u4e14", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u4f46\\%u662f", "examples": "\\%u4f8b\\%u5b50\\>", "feature": "\\%u529f\\%u80fd\\>", "given": "\\%u5047\\%u5982", "scenario": "\\%u573a\\%u666f\\>", "scenario_outline": "\\%u573a\\%u666f\\%u5927\\%u7eb2\\>", "then": "\\%u90a3\\%u4e48", "when": "\\%u5f53"},
+ \"zh-TW": {"and": "\\%u800c\\%u4e14\\|\\%u4e26\\%u4e14", "background": "\\%u80cc\\%u666f\\>", "but": "\\%u4f46\\%u662f", "examples": "\\%u4f8b\\%u5b50\\>", "feature": "\\%u529f\\%u80fd\\>", "given": "\\%u5047\\%u8a2d", "scenario": "\\%u5834\\%u666f\\>\\|\\%u5287\\%u672c\\>", "scenario_outline": "\\%u5834\\%u666f\\%u5927\\%u7db1\\>\\|\\%u5287\\%u672c\\%u5927\\%u7db1\\>", "then": "\\%u90a3\\%u9ebc", "when": "\\%u7576"}}
+
+function! s:pattern(key)
+ let language = matchstr(getline(1),'#\s*language:\s*\zs\S\+')
+ if has_key(g:cucumber_languages, language)
+ let languages = [g:cucumber_languages[language]]
+ else
+ let languages = values(g:cucumber_languages)
+ end
+ return '\<\%('.join(map(languages,'get(v:val,a:key,"\\%(a\\&b\\)")'),'\|').'\)'
+endfunction
+
+function! s:Add(name)
+ let next = " skipempty skipwhite nextgroup=".join(map(["Region","AndRegion","ButRegion","Comment","Table"],'"cucumber".a:name.v:val'),",")
+ exe "syn region cucumber".a:name.'Region matchgroup=cucumber'.a:name.' start="\%(^\s*\)\@<=\%('.s:pattern(tolower(a:name)).'\)" end="$"'.next
+ exe 'syn region cucumber'.a:name.'AndRegion matchgroup=cucumber'.a:name.'And start="\%(^\s*\)\@<='.s:pattern('and').'" end="$" contained'.next
+ exe 'syn region cucumber'.a:name.'ButRegion matchgroup=cucumber'.a:name.'But start="\%(^\s*\)\@<='.s:pattern('but').'" end="$" contained'.next
+ exe 'syn match cucumber'.a:name.'Comment "\%(^\s*\)\@<=#.*" contained'.next
+ exe 'syn match cucumber'.a:name.'Table "\%(^\s*\)\@<=|.*" contained contains=cucumberDelimiter'.next
+ exe 'hi def link cucumber'.a:name.'Comment cucumberComment'
+ exe 'hi def link cucumber'.a:name.'But cucumber'.a:name.'And'
+ exe 'hi def link cucumber'.a:name.'And cucumber'.a:name
+ exe 'syn cluster cucumberStepRegions add=cucumber'.a:name.'Region,cucumber'.a:name.'AndRegion,cucumber'.a:name.'ButRegion'
+endfunction
+
+syn match cucumberComment "\%(^\s*\)\@<=#.*"
+syn match cucumberComment "\%(\%^\s*\)\@<=#.*" contains=cucumberLanguage
+syn match cucumberLanguage "\%(#\s*\)\@<=language:" contained
+syn match cucumberUnparsed "\S.*" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberTags,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty contained
+syn match cucumberUnparsedComment "#.*" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberTags,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty contained
+
+exe 'syn match cucumberFeature "\%(^\s*\)\@<='.s:pattern('feature').':" nextgroup=cucumberUnparsedComment,cucumberUnparsed,cucumberBackground,cucumberScenario,cucumberScenarioOutline,cucumberExamples skipwhite skipempty'
+exe 'syn match cucumberBackground "\%(^\s*\)\@<='.s:pattern('background').':"'
+exe 'syn match cucumberScenario "\%(^\s*\)\@<='.s:pattern('scenario').':"'
+exe 'syn match cucumberScenarioOutline "\%(^\s*\)\@<='.s:pattern('scenario_outline').':"'
+exe 'syn match cucumberExamples "\%(^\s*\)\@<='.s:pattern('examples').':" nextgroup=cucumberExampleTable skipempty skipwhite'
+
+syn match cucumberPlaceholder "<[^<>]*>" contained containedin=@cucumberStepRegions
+syn match cucumberExampleTable "\%(^\s*\)\@<=|.*" contains=cucumberDelimiter
+syn match cucumberDelimiter "|" contained
+syn match cucumberTags "\%(^\s*\)\@<=\%(@[^@[:space:]]\+\s\+\)*@[^@[:space:]]\+\s*$"
+syn region cucumberString start=+\%(^\s*\)\@<="""+ end=+"""+
+
+call s:Add('Then')
+call s:Add('When')
+call s:Add('Given')
+
+hi def link cucumberUnparsedComment cucumberComment
+hi def link cucumberComment Comment
+hi def link cucumberLanguage SpecialComment
+hi def link cucumberFeature Macro
+hi def link cucumberBackground Define
+hi def link cucumberScenario Define
+hi def link cucumberScenarioOutline Define
+hi def link cucumberExamples Define
+hi def link cucumberPlaceholder Constant
+hi def link cucumberDelimiter Delimiter
+hi def link cucumberTags Tag
+hi def link cucumberString String
+hi def link cucumberGiven Conditional
+hi def link cucumberWhen Function
+hi def link cucumberThen Type
+
+let b:current_syntax = "cucumber"
+
+" vim:set sts=2 sw=2: