tt.syntax 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #
  2. # Dan Dascalescu
  3. # Template::Toolkit syntax file
  4. # HTML entities
  5. #
  6. context default
  7. keyword &\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\]; brightgreen
  8. keyword &#\{xX\}\[0123456789abcdefABCDEF\]; brightgreen
  9. keyword &#\[0123456789\]; brightgreen
  10. # Although TT is most often used to generate HTML, it's not *only* used for that, so assuming HTML around it may be presumptuous anyway.
  11. # Since cooledit doesn't support sub-context, we can't have TT *in* HTML, like <img src="[% image_url %]">
  12. # The best possible workaround, which still sucks, is to uncomment the line below, which will highlight any HTML tags that don't contain a '[', but without special highlight for strings, and without any HTML-specific keywords
  13. # keyword <\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890\s"#$%&'()*+,-.=?@\\\]^_`{|}~\]> green
  14. spellcheck
  15. # TT directives - http://template-toolkit.org/docs/manual/Directives.html
  16. context [% %] red black
  17. keyword whole GET yellow
  18. keyword whole CALL yellow
  19. keyword whole SET yellow
  20. keyword whole DEFAULT yellow
  21. keyword whole INSERT yellow
  22. keyword whole INCLUDE yellow
  23. keyword whole PROCESS yellow
  24. keyword whole WRAPPER yellow
  25. keyword whole BLOCK yellow
  26. keyword whole IF yellow
  27. keyword whole UNLESS yellow
  28. keyword whole ELSIF yellow
  29. keyword whole ELSE yellow
  30. keyword whole SWITCH yellow
  31. keyword whole CASE yellow
  32. keyword whole FOREACH yellow
  33. keyword whole IN yellow
  34. keyword whole WHILE yellow
  35. keyword whole FILTER yellow
  36. keyword whole USE yellow
  37. keyword whole MACRO yellow
  38. keyword whole PERL yellow
  39. keyword whole RAWPERL yellow
  40. keyword whole TRY yellow
  41. keyword whole THROW yellow
  42. keyword whole CATCH yellow
  43. keyword whole FINAL yellow
  44. keyword whole NEXT yellow
  45. keyword whole LAST yellow
  46. keyword whole RETURN yellow
  47. keyword whole STOP yellow
  48. keyword whole CLEAR yellow
  49. keyword whole META yellow
  50. keyword whole TAGS yellow
  51. keyword whole DEBUG yellow
  52. keyword whole END yellow
  53. # AND, OR and NOT are apparently not documented
  54. keyword whole AND white
  55. keyword whole OR white
  56. keyword whole NOT white
  57. keyword | white
  58. # TT VMethods - http://template-toolkit.org/docs/manual/VMethods.html
  59. keyword .defined brown
  60. keyword .length brown
  61. keyword .repeat brown
  62. keyword .replace brown
  63. keyword .remove brown
  64. keyword .match brown
  65. keyword .search brown
  66. keyword .split brown
  67. keyword .chunk brown
  68. keyword .substr brown
  69. keyword .list brown
  70. keyword .hash brown
  71. keyword .size brown
  72. keyword .keys brown
  73. keyword .values brown
  74. keyword .items brown
  75. keyword .each brown
  76. keyword .pairs brown
  77. keyword .sort brown
  78. keyword .nsort brown
  79. keyword .import brown
  80. keyword .exists brown
  81. keyword .delete brown
  82. keyword .item brown
  83. keyword .first brown
  84. keyword .last brown
  85. keyword .max brown
  86. keyword .reverse brown
  87. keyword .join brown
  88. keyword .grep brown
  89. keyword .unshift brown
  90. keyword .push brown
  91. keyword .shift brown
  92. keyword .pop brown
  93. keyword .unique brown
  94. keyword .merge brown
  95. keyword .slice brown
  96. keyword .splice brown
  97. keyword "*" green
  98. keyword '*' brightgreen
  99. # HTML comments
  100. context <!-- --> brown
  101. spellcheck
  102. # HTML DOCTYPE
  103. context <! > brightred/orange
  104. spellcheck
  105. # HTML end tags
  106. context </ > brightcyan
  107. # HTML open tags - enabling this will hide TT syntax in HTML, e.g. <img src="[% image_url %]">
  108. #context < > brightcyan
  109. # keyword "*" green
  110. # keyword = yellow