cf.vim 18 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019
  1. " Vim syntax file
  2. "
  3. " Language: CFML (ColdFusion)
  4. " Author: Ernst M. van der Linden <ernst.vanderlinden@ernestoz.com>
  5. " License: The MIT License (MIT)
  6. "
  7. " Maintainer: Ernst M. van der Linden <ernst.vanderlinden@ernestoz.com>
  8. " URL: https://github.com/ernstvanderlinden/vim-coldfusion
  9. " Last Change: 2017 Nov 28
  10. "
  11. " Filenames: *.cfc *.cfm
  12. " Quit when a syntax file was already loaded.
  13. if exists("b:current_syntax")
  14. finish
  15. endif
  16. " Using line continuation here.
  17. let s:cpo_save=&cpo
  18. set cpo-=C
  19. sy sync fromstart
  20. " 20171126: disabled as we have fast computers now.
  21. "sy sync maxlines=2000
  22. sy case ignore
  23. " INCLUDES {{{
  24. sy include @sqlSyntax $VIMRUNTIME/syntax/sql.vim
  25. " 20161010: Disabled include html highlighting as it contains huge keywords
  26. " regex, so it will have impact on performance. Use own simple SGML tag
  27. " coloring instead.
  28. "runtime! syntax/html.vim
  29. " / INCLUDES }}}
  30. " NUMBER {{{
  31. sy match cfmlNumber
  32. \ "\v<\d+>"
  33. " / NUMBER }}}
  34. " EQUAL SIGN {{{
  35. sy match cfmlEqualSign
  36. \ "\v\="
  37. " / EQUAL SIGN }}}
  38. " BOOLEAN {{{
  39. sy match cfmlBoolean
  40. \ "\v<(true|false)>"
  41. " / BOOLEAN }}}
  42. " HASH SURROUNDED {{{
  43. sy region cfmlHashSurround
  44. \ keepend
  45. \ oneline
  46. \ start="#"
  47. \ end="#"
  48. \ skip="##"
  49. \ contains=
  50. \@cfmlOperator,
  51. \@cfmlPunctuation,
  52. \cfmlBoolean,
  53. \cfmlCoreKeyword,
  54. \cfmlCoreScope,
  55. \cfmlCustomKeyword,
  56. \cfmlCustomScope,
  57. \cfmlEqualSign,
  58. \cfmlFunctionName,
  59. \cfmlNumber
  60. " / HASH SURROUNDED }}}
  61. " OPERATOR {{{
  62. " OPERATOR - ARITHMETIC {{{
  63. " +7 -7
  64. " ++i --i
  65. " i++ i--
  66. " + - * / %
  67. " += -= *= /= %=
  68. " ^ mod
  69. sy match cfmlArithmeticOperator
  70. \ "\v
  71. \(\+|-)\ze\d
  72. \|(\+\+|--)\ze\w
  73. \|\w\zs(\+\+|--)
  74. \|(\s(
  75. \(\+|-|\*|\/|\%){1}\={,1}
  76. \|\^
  77. \|mod
  78. \)\s)
  79. \"
  80. " / OPERATOR - ARITHMETIC }}}
  81. " OPERATOR - BOOLEAN {{{
  82. " not and or xor eqv imp
  83. " ! && ||
  84. sy match cfmlBooleanOperator
  85. \ "\v\s
  86. \(not|and|or|xor|eqv|imp
  87. \|\!|\&\&|\|\|
  88. \)(\s|\))
  89. \|\s\!\ze\w
  90. \"
  91. " / OPERATOR - BOOLEAN }}}
  92. " OPERATOR - DECISION {{{
  93. "is|equal|eq
  94. "is not|not equal|neq
  95. "contains|does not contain
  96. "greater than|gt
  97. "less than|lt
  98. "greater than or equal to|gte|ge
  99. "less than or equal to|lte|le
  100. "==|!=|>|<|>=|<=
  101. sy match cfmlDecisionOperator
  102. \ "\v\s
  103. \(is|equal|eq
  104. \|is not|not equal|neq
  105. \|contains|does not contain
  106. \|greater than|gt
  107. \|less than|lt
  108. \|greater than or equal to|gte|ge
  109. \|less than or equal to|lte|le
  110. \|(!|\<|\>|\=){1}\=
  111. \|\<
  112. \|\>
  113. \)\s"
  114. " / OPERATOR - DECISION }}}
  115. " OPERATOR - STRING {{{
  116. " &
  117. " &=
  118. sy match cfmlStringOperator
  119. \ "\v\s\&\={,1}\s"
  120. " / OPERATOR - STRING }}}
  121. " OPERATOR - TERNARY {{{
  122. " ? :
  123. sy match cfmlTernaryOperator
  124. \ "\v\s
  125. \\?|\:
  126. \\s"
  127. " / OPERATOR - TERNARY }}}
  128. sy cluster cfmlOperator
  129. \ contains=
  130. \cfmlArithmeticOperator,
  131. \cfmlBooleanOperator,
  132. \cfmlDecisionOperator,
  133. \cfmlStringOperator,
  134. \cfmlTernaryOperator
  135. " / OPERATOR }}}
  136. " PARENTHESIS {{{
  137. sy cluster cfmlParenthesisRegionContains
  138. \ contains=
  139. \@cfmlAttribute,
  140. \@cfmlComment,
  141. \@cfmlFlowStatement,
  142. \@cfmlOperator,
  143. \@cfmlPunctuation,
  144. \cfmlBoolean,
  145. \cfmlBrace,
  146. \cfmlCoreKeyword,
  147. \cfmlCoreScope,
  148. \cfmlCustomKeyword,
  149. \cfmlCustomScope,
  150. \cfmlEqualSign,
  151. \cfmlFunctionName,
  152. \cfmlNumber,
  153. \cfmlStorageKeyword,
  154. \cfmlStorageType
  155. sy region cfmlParenthesisRegion1
  156. \ extend
  157. \ matchgroup=cfmlParenthesis1
  158. \ transparent
  159. \ start=/(/
  160. \ end=/)/
  161. \ contains=
  162. \cfmlParenthesisRegion2,
  163. \@cfmlParenthesisRegionContains
  164. sy region cfmlParenthesisRegion2
  165. \ matchgroup=cfmlParenthesis2
  166. \ transparent
  167. \ start=/(/
  168. \ end=/)/
  169. \ contains=
  170. \cfmlParenthesisRegion3,
  171. \@cfmlParenthesisRegionContains
  172. sy region cfmlParenthesisRegion3
  173. \ matchgroup=cfmlParenthesis3
  174. \ transparent
  175. \ start=/(/
  176. \ end=/)/
  177. \ contains=
  178. \cfmlParenthesisRegion1,
  179. \@cfmlParenthesisRegionContains
  180. sy cluster cfmlParenthesisRegion
  181. \ contains=
  182. \cfmlParenthesisRegion1,
  183. \cfmlParenthesisRegion2,
  184. \cfmlParenthesisRegion3
  185. " / PARENTHESIS }}}
  186. " BRACE {{{
  187. sy match cfmlBrace
  188. \ "{\|}"
  189. sy region cfmlBraceRegion
  190. \ extend
  191. \ fold
  192. \ keepend
  193. \ transparent
  194. \ start="{"
  195. \ end="}"
  196. " / BRACE }}}
  197. " PUNCTUATION {{{
  198. " PUNCTUATION - BRACKET {{{
  199. sy match cfmlBracket
  200. \ "\(\[\|\]\)"
  201. \ contained
  202. " / PUNCTUATION - BRACKET }}}
  203. " PUNCTUATION - CHAR {{{
  204. sy match cfmlComma ","
  205. sy match cfmlDot "\."
  206. sy match cfmlSemiColon ";"
  207. " / PUNCTUATION - CHAR }}}
  208. " PUNCTUATION - QUOTE {{{
  209. sy region cfmlSingleQuotedValue
  210. \ matchgroup=cfmlSingleQuote
  211. \ start=/'/
  212. \ skip=/''/
  213. \ end=/'/
  214. \ contains=
  215. \cfmlHashSurround
  216. sy region cfmlDoubleQuotedValue
  217. \ matchgroup=cfmlDoubleQuote
  218. \ start=/"/
  219. \ skip=/""/
  220. \ end=/"/
  221. \ contains=
  222. \cfmlHashSurround
  223. sy cluster cfmlQuotedValue
  224. \ contains=
  225. \cfmlDoubleQuotedValue,
  226. \cfmlSingleQuotedValue
  227. sy cluster cfmlQuote
  228. \ contains=
  229. \cfmlDoubleQuote,
  230. \cfmlSingleQuote
  231. " / PUNCTUATION - QUOTE }}}
  232. sy cluster cfmlPunctuation
  233. \ contains=
  234. \@cfmlQuote,
  235. \@cfmlQuotedValue,
  236. \cfmlBracket,
  237. \cfmlComma,
  238. \cfmlDot,
  239. \cfmlSemiColon
  240. " / PUNCTUATION }}}
  241. " TAG START AND END {{{
  242. " tag start
  243. " <cf...>
  244. " s^^ e
  245. sy region cfmlTagStart
  246. \ keepend
  247. \ transparent
  248. \ start="\c<cf_*"
  249. \ end=">"
  250. \ contains=
  251. \@cfmlAttribute,
  252. \@cfmlComment,
  253. \@cfmlOperator,
  254. \@cfmlParenthesisRegion,
  255. \@cfmlPunctuation,
  256. \@cfmlQuote,
  257. \@cfmlQuotedValue,
  258. \cfmlAttrEqualSign,
  259. \cfmlBoolean,
  260. \cfmlBrace,
  261. \cfmlCoreKeyword,
  262. \cfmlCoreScope,
  263. \cfmlCustomKeyword,
  264. \cfmlCustomScope,
  265. \cfmlEqualSign,
  266. \cfmlFunctionName,
  267. \cfmlNumber,
  268. \cfmlStorageKeyword,
  269. \cfmlStorageType,
  270. \cfmlTagBracket,
  271. \cfmlTagName
  272. " tag end
  273. " </cf...>
  274. " s^^^ e
  275. sy match cfmlTagEnd
  276. \ transparent
  277. \ "\c</cf_*[^>]*>"
  278. \ contains=
  279. \cfmlTagBracket,
  280. \cfmlTagName
  281. " tag bracket
  282. " </...>
  283. " ^^ ^
  284. sy match cfmlTagBracket
  285. \ contained
  286. \ "\(<\|>\|\/\)"
  287. " tag name
  288. " <cf...>
  289. " s^^^e
  290. sy match cfmlTagName
  291. \ contained
  292. \ "\v<\/*\zs\ccf\w*"
  293. " / TAG START AND END }}}
  294. " ATTRIBUTE NAME AND VALUE {{{
  295. sy match cfmlAttrName
  296. \ contained
  297. \ "\v(var\s)@<!\w+\ze\s*\=([^\=])+"
  298. sy match cfmlAttrValue
  299. \ contained
  300. \ "\v(\=\"*)\zs\s*\w*"
  301. sy match cfmlAttrEqualSign
  302. \ contained
  303. \ "\v\="
  304. sy cluster cfmlAttribute
  305. \ contains=
  306. \@cfmlQuotedValue,
  307. \cfmlAttrEqualSign,
  308. \cfmlAttrName,
  309. \cfmlAttrValue,
  310. \cfmlCoreKeyword,
  311. \cfmlCoreScope
  312. " / ATTRIBUTE NAME AND VALUE }}}
  313. " TAG REGION AND FOLDING {{{
  314. " CFCOMPONENT REGION AND FOLD {{{
  315. " <cfcomponent
  316. " s^^^^^^^^^^^
  317. " </cfcomponent>
  318. " ^^^^^^^^^^^^^e
  319. sy region cfmlComponentTagRegion
  320. \ fold
  321. \ keepend
  322. \ transparent
  323. \ start="\c<cfcomponent"
  324. \ end="\c</cfcomponent>"
  325. " / CFCOMPONENT REGION AND FOLD }}}
  326. " CFFUNCTION REGION AND FOLD {{{
  327. " <cffunction
  328. " s^^^^^^^^^^
  329. " </cffunction>
  330. " ^^^^^^^^^^^^e
  331. sy region cfmlFunctionTagRegion
  332. \ fold
  333. \ keepend
  334. \ transparent
  335. \ start="\c<cffunction"
  336. \ end="\c</cffunction>"
  337. " / CFFUNCTION REGION AND FOLD }}}
  338. " CFIF REGION AND FOLD {{{
  339. " <cfif
  340. " s^^^^
  341. " </cfif>
  342. " ^^^^^^e
  343. sy region cfmlIfTagRegion
  344. \ fold
  345. \ keepend
  346. \ transparent
  347. \ start="\c<cfif"
  348. \ end="\c</cfif>"
  349. " / CFIF REGION AND FOLD }}}
  350. " CFLOOP REGION AND FOLD {{{
  351. " <cfloop
  352. " s^^^^^^
  353. " </cfloop>
  354. " ^^^^^^^^e
  355. sy region cfmlLoopTagRegion
  356. \ fold
  357. \ keepend
  358. \ transparent
  359. \ start="\c<cfloop"
  360. \ end="\c</cfloop>"
  361. " / CFLOOP REGION AND FOLD }}}
  362. " CFOUTPUT REGION AND FOLD {{{
  363. " <cfoutput
  364. " s^^^^^^^^
  365. " </cfoutput>
  366. " ^^^^^^^^^^e
  367. sy region cfmlOutputTagRegion
  368. \ fold
  369. \ keepend
  370. \ transparent
  371. \ start="\c<cfoutput"
  372. \ end="\c</cfoutput>"
  373. " / CFOUTPUT REGION AND FOLD }}}
  374. " CFQUERY REGION AND FOLD {{{
  375. " <cfquery
  376. " s^^^^^^^
  377. " </cfquery>
  378. " ^^^^^^^^^e
  379. "\@cfmlSqlStatement,
  380. sy region cfmlQueryTagRegion
  381. \ fold
  382. \ keepend
  383. \ transparent
  384. \ start="\c<cfquery"
  385. \ end="\c</cfquery>"
  386. \ contains=
  387. \@cfmlSqlStatement,
  388. \cfmlTagStart,
  389. \cfmlTagEnd,
  390. \cfmlTagComment
  391. " / CFQUERY REGION AND FOLD }}}
  392. " SAVECONTENT REGION AND FOLD {{{
  393. " <savecontent
  394. " s^^^^^^^^^^^
  395. " </savecontent>
  396. " ^^^^^^^^^^^^^e
  397. sy region cfmlSavecontentTagRegion
  398. \ fold
  399. \ keepend
  400. \ transparent
  401. \ start="\c<cfsavecontent"
  402. \ end="\c</cfsavecontent>"
  403. " / SAVECONTENT REGION AND FOLD }}}
  404. " CFSCRIPT REGION AND FOLD {{{
  405. " <cfscript>
  406. " s^^^^^^^^^
  407. " </cfscript>
  408. " ^^^^^^^^^^e
  409. "\cfmlCustomScope,
  410. sy region cfmlScriptTagRegion
  411. \ fold
  412. \ keepend
  413. \ transparent
  414. \ start="\c<cfscript>"
  415. \ end="\c</cfscript>"
  416. \ contains=
  417. \@cfmlComment,
  418. \@cfmlFlowStatement,
  419. \cfmlHashSurround,
  420. \@cfmlOperator,
  421. \@cfmlParenthesisRegion,
  422. \@cfmlPunctuation,
  423. \cfmlBoolean,
  424. \cfmlBrace,
  425. \cfmlCoreKeyword,
  426. \cfmlCoreScope,
  427. \cfmlCustomKeyword,
  428. \cfmlCustomScope,
  429. \cfmlEqualSign,
  430. \cfmlFunctionDefinition,
  431. \cfmlFunctionName,
  432. \cfmlNumber,
  433. \cfmlOddFunction,
  434. \cfmlStorageKeyword,
  435. \cfmlTagEnd,
  436. \cfmlTagStart
  437. " / CFSCRIPT REGION AND FOLD }}}
  438. " CFSWITCH REGION AND FOLD {{{
  439. " <cfswitch
  440. " s^^^^^^^^
  441. " </cfswitch>
  442. " ^^^^^^^^^^e
  443. sy region cfmlSwitchTagRegion
  444. \ fold
  445. \ keepend
  446. \ transparent
  447. \ start="\c<cfswitch"
  448. \ end="\c</cfswitch>"
  449. " / CFSWITCH REGION AND FOLD }}}
  450. " CFTRANSACTION REGION AND FOLD {{{
  451. " <cftransaction
  452. " s^^^^^^^^^^^^^
  453. " </cftransaction>
  454. " ^^^^^^^^^^^^^^^e
  455. sy region cfmlTransactionTagRegion
  456. \ fold
  457. \ keepend
  458. \ transparent
  459. \ start="\c<cftransaction"
  460. \ end="\c</cftransaction>"
  461. " / CFTRANSACTION REGION AND FOLD }}}
  462. " CUSTOM TAG REGION AND FOLD {{{
  463. " <cf_...>
  464. " s^^^ ^
  465. " </cf_...>
  466. " ^^^^^ e
  467. sy region cfmlCustomTagRegion
  468. \ fold
  469. \ keepend
  470. \ transparent
  471. \ start="\c<cf_[^>]*>"
  472. \ end="\c</cf_[^>]*>"
  473. " / CUSTOM TAG REGION AND FOLD }}}
  474. " / TAG REGION AND FOLDING }}}
  475. " COMMENT {{{
  476. " COMMENT BLOCK {{{
  477. " /*...*/
  478. " s^ ^e
  479. sy region cfmlCommentBlock
  480. \ keepend
  481. \ start="/\*"
  482. \ end="\*/"
  483. \ contains=
  484. \cfmlMetaData
  485. " / COMMENT BLOCK }}}
  486. " COMMENT LINE {{{
  487. " //...
  488. " s^
  489. sy match cfmlCommentLine
  490. \ "\/\/.*"
  491. " / COMMENT LINE }}}
  492. sy cluster cfmlComment
  493. \ contains=
  494. \cfmlCommentBlock,
  495. \cfmlCommentLine
  496. " / COMMENT }}}
  497. " TAG COMMENT {{{
  498. " <!---...--->
  499. " s^^^^ ^^^e
  500. sy region cfmlTagComment
  501. \ keepend
  502. \ start="<!---"
  503. \ end="--->"
  504. \ contains=
  505. \cfmlTagComment
  506. " / TAG COMMENT }}}
  507. " FLOW STATEMENT {{{
  508. " BRANCH FLOW KEYWORD {{{
  509. sy keyword cfmlBranchFlowKeyword
  510. \ break
  511. \ continue
  512. \ return
  513. " / BRANCH KEYWORD }}}
  514. " DECISION FLOW KEYWORD {{{
  515. sy keyword cfmlDecisionFlowKeyword
  516. \ case
  517. \ defaultcase
  518. \ else
  519. \ if
  520. \ switch
  521. " / DECISION FLOW KEYWORD }}}
  522. " LOOP FLOW KEYWORD {{{
  523. sy keyword cfmlLoopFlowKeyword
  524. \ do
  525. \ for
  526. \ in
  527. \ while
  528. " / LOOP FLOW KEYWORD }}}
  529. " TRY FLOW KEYWORD {{{
  530. sy keyword cfmlTryFlowKeyword
  531. \ catch
  532. \ finally
  533. \ rethrow
  534. \ throw
  535. \ try
  536. " / TRY FLOW KEYWORD }}}
  537. sy cluster cfmlFlowStatement
  538. \ contains=
  539. \cfmlBranchFlowKeyword,
  540. \cfmlDecisionFlowKeyword,
  541. \cfmlLoopFlowKeyword,
  542. \cfmlTryFlowKeyword
  543. " / FLOW STATEMENT }}}
  544. " STORAGE KEYWORD {{{
  545. sy keyword cfmlStorageKeyword
  546. \ var
  547. " / STORAGE KEYWORD }}}
  548. " STORAGE TYPE {{{
  549. sy match cfmlStorageType
  550. \ contained
  551. \ "\v<
  552. \(any
  553. \|array
  554. \|binary
  555. \|boolean
  556. \|date
  557. \|numeric
  558. \|query
  559. \|string
  560. \|struct
  561. \|uuid
  562. \|void
  563. \|xml
  564. \){1}\ze(\s*\=)@!"
  565. " / STORAGE TYPE }}}
  566. " CORE KEYWORD {{{
  567. sy match cfmlCoreKeyword
  568. \ "\v<
  569. \(new
  570. \|required
  571. \)\ze\s"
  572. " / CORE KEYWORD }}}
  573. " CORE SCOPE {{{
  574. sy match cfmlCoreScope
  575. \ "\v<
  576. \(application
  577. \|arguments
  578. \|attributes
  579. \|caller
  580. \|cfcatch
  581. \|cffile
  582. \|cfhttp
  583. \|cgi
  584. \|client
  585. \|cookie
  586. \|form
  587. \|local
  588. \|request
  589. \|server
  590. \|session
  591. \|super
  592. \|this
  593. \|thisTag
  594. \|thread
  595. \|variables
  596. \|url
  597. \){1}\ze(,|\.|\[|\)|\s)"
  598. " / CORE SCOPE }}}
  599. " SQL STATEMENT {{{
  600. sy cluster cfmlSqlStatement
  601. \ contains=
  602. \@cfmlParenthesisRegion,
  603. \@cfmlQuote,
  604. \@cfmlQuotedValue,
  605. \@sqlSyntax,
  606. \cfmlBoolean,
  607. \cfmlDot,
  608. \cfmlEqualSign,
  609. \cfmlFunctionName,
  610. \cfmlHashSurround,
  611. \cfmlNumber
  612. " / SQL STATEMENT }}}
  613. " TAG IN SCRIPT {{{
  614. sy match cfmlTagNameInScript
  615. \ "\vcf_*\w+\s*\ze\("
  616. " / TAG IN SCRIPT }}}
  617. " METADATA {{{
  618. sy region cfmlMetaData
  619. \ contained
  620. \ keepend
  621. \ start="@\w\+"
  622. \ end="$"
  623. \ contains=
  624. \cfmlMetaDataName
  625. sy match cfmlMetaDataName
  626. \ contained
  627. \ "@\w\+"
  628. " / METADATA }}}
  629. " COMPONENT DEFINITION {{{
  630. sy region cfmlComponentDefinition
  631. \ start="component"
  632. \ end="{"me=e-1
  633. \ contains=
  634. \@cfmlAttribute,
  635. \cfmlComponentKeyword
  636. sy match cfmlComponentKeyword
  637. \ contained
  638. \ "\v<component>"
  639. " / COMPONENT DEFINITION }}}
  640. " INTERFACE DEFINITION {{{
  641. sy match cfmlInterfaceDefinition
  642. \ "interface\s.*{"me=e-1
  643. \ contains=
  644. \cfmlInterfaceKeyword
  645. sy match cfmlInterfaceKeyword
  646. \ contained
  647. \ "\v<interface>"
  648. " / INTERFACE DEFINITION }}}
  649. " PROPERTY {{{
  650. sy region cfmlProperty
  651. \ transparent
  652. \ start="\v<property>"
  653. \ end=";"me=e-1
  654. \ contains=
  655. \@cfmlQuotedValue,
  656. \cfmlAttrEqualSign,
  657. \cfmlAttrName,
  658. \cfmlAttrValue,
  659. \cfmlPropertyKeyword
  660. sy match cfmlPropertyKeyword
  661. \ contained
  662. \ "\v<property>"
  663. " / PROPERTY }}}
  664. " FUNCTION DEFINITION {{{
  665. sy match cfmlFunctionDefinition
  666. \ "\v
  667. \(<(public|private|package)\s){,1}
  668. \(<
  669. \(any
  670. \|array
  671. \|binary
  672. \|boolean
  673. \|date
  674. \|numeric
  675. \|query
  676. \|string
  677. \|struct
  678. \|uuid
  679. \|void
  680. \|xml
  681. \)\s){,1}
  682. \<function\s\w+\s*\("me=e-1
  683. \ contains=
  684. \cfmlFunctionKeyword,
  685. \cfmlFunctionModifier,
  686. \cfmlFunctionName,
  687. \cfmlFunctionReturnType
  688. " FUNCTION KEYWORD {{{
  689. sy match cfmlFunctionKeyword
  690. \ contained
  691. \ "\v<function>"
  692. " / FUNCTION KEYWORD }}}
  693. " FUNCTION MODIFIER {{{
  694. sy match cfmlFunctionModifier
  695. \ contained
  696. \ "\v<
  697. \(public
  698. \|private
  699. \|package
  700. \)>"
  701. " / FUNCTION MODIFIER }}}
  702. " FUNCTION RETURN TYPE {{{
  703. sy match cfmlFunctionReturnType
  704. \ contained
  705. \ "\v
  706. \(any
  707. \|array
  708. \|binary
  709. \|boolean
  710. \|date
  711. \|numeric
  712. \|query
  713. \|string
  714. \|struct
  715. \|uuid
  716. \|void
  717. \|xml
  718. \)"
  719. " / FUNCTION RETURN TYPE }}}
  720. " FUNCTION NAME {{{
  721. " specific regex for core functions decreases performance
  722. " so use the same highlighting for both function types
  723. sy match cfmlFunctionName
  724. \ "\v<(cf|if|elseif|throw)@!\w+\s*\ze\("
  725. " / FUNCTION NAME }}}
  726. " / FUNCTION DEFINITION }}}
  727. " ODD FUNCTION {{{
  728. sy region cfmlOddFunction
  729. \ transparent
  730. \ start="\v<
  731. \(abort
  732. \|exit
  733. \|import
  734. \|include
  735. \|lock
  736. \|pageencoding
  737. \|param
  738. \|savecontent
  739. \|thread
  740. \|transaction
  741. \){1}"
  742. \ end="\v(\{|;)"me=e-1
  743. \ contains=
  744. \@cfmlQuotedValue,
  745. \cfmlAttrEqualSign,
  746. \cfmlAttrName,
  747. \cfmlAttrValue,
  748. \cfmlCoreKeyword,
  749. \cfmlOddFunctionKeyword,
  750. \cfmlCoreScope
  751. " ODD FUNCTION KEYWORD {{{
  752. sy match cfmlOddFunctionKeyword
  753. \ contained
  754. \ "\v<
  755. \(abort
  756. \|exit
  757. \|import
  758. \|include
  759. \|lock
  760. \|pageencoding
  761. \|param
  762. \|savecontent
  763. \|thread
  764. \|transaction
  765. \)\ze(\s|$|;)"
  766. " / ODD FUNCTION KEYWORD }}}
  767. " / ODD FUNCTION }}}
  768. " CUSTOM {{{
  769. " CUSTOM KEYWORD {{{
  770. sy match cfmlCustomKeyword
  771. \ contained
  772. \ "\v<
  773. \(customKeyword1
  774. \|customKeyword2
  775. \|customKeyword3
  776. \)>"
  777. " / CUSTOM KEYWORD }}}
  778. " CUSTOM SCOPE {{{
  779. sy match cfmlCustomScope
  780. \ contained
  781. \ "\v<
  782. \(prc
  783. \|rc
  784. \|event
  785. \|(\w+Service)
  786. \){1}\ze(\.|\[)"
  787. " / CUSTOM SCOPE }}}
  788. " / CUSTOM }}}
  789. " SGML TAG START AND END {{{
  790. " SGML tag start
  791. " <...>
  792. " s^^^e
  793. sy region cfmlSGMLTagStart
  794. \ keepend
  795. \ transparent
  796. \ start="\v(\<cf)@!\zs\<\w+"
  797. \ end=">"
  798. \ contains=
  799. \@cfmlAttribute,
  800. \@cfmlComment,
  801. \@cfmlOperator,
  802. \@cfmlParenthesisRegion,
  803. \@cfmlPunctuation,
  804. \@cfmlQuote,
  805. \@cfmlQuotedValue,
  806. \cfmlAttrEqualSign,
  807. \cfmlBoolean,
  808. \cfmlBrace,
  809. \cfmlCoreKeyword,
  810. \cfmlCoreScope,
  811. \cfmlCustomKeyword,
  812. \cfmlCustomScope,
  813. \cfmlEqualSign,
  814. \cfmlFunctionName,
  815. \cfmlNumber,
  816. \cfmlStorageKeyword,
  817. \cfmlStorageType,
  818. \cfmlTagBracket,
  819. \cfmlSGMLTagName
  820. " SGML tag end
  821. " </...>
  822. " s^^^^e
  823. sy match cfmlSGMLTagEnd
  824. \ transparent
  825. \ "\v(\<\/cf)@!\zs\<\/\w+\>"
  826. \ contains=
  827. \cfmlTagBracket,
  828. \cfmlSGMLTagName
  829. " SGML tag name
  830. " <...>
  831. " s^^^e
  832. sy match cfmlSGMLTagName
  833. \ contained
  834. \ "\v(\<\/*)\zs\w+"
  835. " / SGML TAG START AND END }}}
  836. " HIGHLIGHTING {{{
  837. hi link cfmlNumber Number
  838. hi link cfmlBoolean Boolean
  839. hi link cfmlEqualSign Keyword
  840. " HASH SURROUND
  841. hi link cfmlHash PreProc
  842. hi link cfmlHashSurround PreProc
  843. " OPERATOR
  844. hi link cfmlArithmeticOperator Function
  845. hi link cfmlBooleanOperator Function
  846. hi link cfmlDecisionOperator Function
  847. hi link cfmlStringOperator Function
  848. hi link cfmlTernaryOperator Function
  849. " PARENTHESIS
  850. hi link cfmlParenthesis1 Statement
  851. hi link cfmlParenthesis2 String
  852. hi link cfmlParenthesis3 Delimiter
  853. " BRACE
  854. hi link cfmlBrace PreProc
  855. " PUNCTUATION - BRACKET
  856. hi link cfmlBracket Statement
  857. " PUNCTUATION - CHAR
  858. hi link cfmlComma Comment
  859. hi link cfmlDot Comment
  860. hi link cfmlSemiColon Comment
  861. " PUNCTUATION - QUOTE
  862. hi link cfmlDoubleQuote String
  863. hi link cfmlDoubleQuotedValue String
  864. hi link cfmlSingleQuote String
  865. hi link cfmlSingleQuotedValue String
  866. " TAG START AND END
  867. hi link cfmlTagName Function
  868. hi link cfmlTagBracket Comment
  869. " ATTRIBUTE NAME AND VALUE
  870. hi link cfmlAttrName Type
  871. hi link cfmlAttrValue Special
  872. " COMMENT
  873. hi link cfmlCommentBlock Comment
  874. hi link cfmlCommentLine Comment
  875. hi link cfmlTagComment Comment
  876. " FLOW STATEMENT
  877. hi link cfmlDecisionFlowKeyword Conditional
  878. hi link cfmlLoopFlowKeyword Repeat
  879. hi link cfmlTryFlowKeyword Exception
  880. hi link cfmlBranchFlowKeyword Keyword
  881. " STORAGE KEYWORD
  882. hi link cfmlStorageKeyword Keyword
  883. " STORAGE TYPE
  884. hi link cfmlStorageType Keyword
  885. " CORE KEYWORD
  886. hi link cfmlCoreKeyword PreProc
  887. " CORE SCOPE
  888. hi link cfmlCoreScope Keyword
  889. " TAG IN SCRIPT
  890. hi link cfmlTagNameInScript Function
  891. " METADATA
  892. " meta data value = cfmlMetaData
  893. hi link cfmlMetaData String
  894. hi link cfmlMetaDataName Type
  895. " COMPONENT DEFINITION
  896. hi link cfmlComponentKeyword Keyword
  897. " INTERFACE DEFINITION
  898. hi link cfmlInterfaceKeyword Keyword
  899. " PROPERTY
  900. hi link cfmlPropertyKeyword Keyword
  901. " FUNCTION DEFINITION
  902. hi link cfmlFunctionKeyword Keyword
  903. hi link cfmlFunctionModifier Keyword
  904. hi link cfmlFunctionReturnType Keyword
  905. hi link cfmlFunctionName Function
  906. " ODD FUNCTION
  907. hi link cfmlOddFunctionKeyword Function
  908. " CUSTOM
  909. hi link cfmlCustomKeyword Keyword
  910. hi link cfmlCustomScope Structure
  911. " SGML TAG
  912. hi link cfmlSGMLTagName Ignore
  913. " / HIGHLIGHTING }}}
  914. let b:current_syntax = "cfml"
  915. let &cpo = s:cpo_save
  916. unlet s:cpo_save