tcl.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ace.define("ace/snippets/tcl",["require","exports","module"], function(require, exports, module) {
  2. "use strict";
  3. exports.snippetText = "# #!/usr/bin/env tclsh\n\
  4. snippet #!\n\
  5. #!/usr/bin/env tclsh\n\
  6. \n\
  7. # Process\n\
  8. snippet pro\n\
  9. proc ${1:function_name} {${2:args}} {\n\
  10. ${3:#body ...}\n\
  11. }\n\
  12. #xif\n\
  13. snippet xif\n\
  14. ${1:expr}? ${2:true} : ${3:false}\n\
  15. # Conditional\n\
  16. snippet if\n\
  17. if {${1}} {\n\
  18. ${2:# body...}\n\
  19. }\n\
  20. # Conditional if..else\n\
  21. snippet ife\n\
  22. if {${1}} {\n\
  23. ${2:# body...}\n\
  24. } else {\n\
  25. ${3:# else...}\n\
  26. }\n\
  27. # Conditional if..elsif..else\n\
  28. snippet ifee\n\
  29. if {${1}} {\n\
  30. ${2:# body...}\n\
  31. } elseif {${3}} {\n\
  32. ${4:# elsif...}\n\
  33. } else {\n\
  34. ${5:# else...}\n\
  35. }\n\
  36. # If catch then\n\
  37. snippet ifc\n\
  38. if { [catch {${1:#do something...}} ${2:err}] } {\n\
  39. ${3:# handle failure...}\n\
  40. }\n\
  41. # Catch\n\
  42. snippet catch\n\
  43. catch {${1}} ${2:err} ${3:options}\n\
  44. # While Loop\n\
  45. snippet wh\n\
  46. while {${1}} {\n\
  47. ${2:# body...}\n\
  48. }\n\
  49. # For Loop\n\
  50. snippet for\n\
  51. for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {\n\
  52. ${4:# body...}\n\
  53. }\n\
  54. # Foreach Loop\n\
  55. snippet fore\n\
  56. foreach ${1:x} {${2:#list}} {\n\
  57. ${3:# body...}\n\
  58. }\n\
  59. # after ms script...\n\
  60. snippet af\n\
  61. after ${1:ms} ${2:#do something}\n\
  62. # after cancel id\n\
  63. snippet afc\n\
  64. after cancel ${1:id or script}\n\
  65. # after idle\n\
  66. snippet afi\n\
  67. after idle ${1:script}\n\
  68. # after info id\n\
  69. snippet afin\n\
  70. after info ${1:id}\n\
  71. # Expr\n\
  72. snippet exp\n\
  73. expr {${1:#expression here}}\n\
  74. # Switch\n\
  75. snippet sw\n\
  76. switch ${1:var} {\n\
  77. ${3:pattern 1} {\n\
  78. ${4:#do something}\n\
  79. }\n\
  80. default {\n\
  81. ${2:#do something}\n\
  82. }\n\
  83. }\n\
  84. # Case\n\
  85. snippet ca\n\
  86. ${1:pattern} {\n\
  87. ${2:#do something}\n\
  88. }${3}\n\
  89. # Namespace eval\n\
  90. snippet ns\n\
  91. namespace eval ${1:path} {${2:#script...}}\n\
  92. # Namespace current\n\
  93. snippet nsc\n\
  94. namespace current\n\
  95. ";
  96. exports.scope = "tcl";
  97. });