lua.js 895 B

123456789101112131415161718192021222324252627282930313233343536
  1. ace.define("ace/snippets/lua",[], function(require, exports, module) {
  2. "use strict";
  3. exports.snippetText = "snippet #!\n\
  4. #!/usr/bin/env lua\n\
  5. $1\n\
  6. snippet local\n\
  7. local ${1:x} = ${2:1}\n\
  8. snippet fun\n\
  9. function ${1:fname}(${2:...})\n\
  10. ${3:-- body}\n\
  11. end\n\
  12. snippet for\n\
  13. for ${1:i}=${2:1},${3:10} do\n\
  14. ${4:print(i)}\n\
  15. end\n\
  16. snippet forp\n\
  17. for ${1:i},${2:v} in pairs(${3:table_name}) do\n\
  18. ${4:-- body}\n\
  19. end\n\
  20. snippet fori\n\
  21. for ${1:i},${2:v} in ipairs(${3:table_name}) do\n\
  22. ${4:-- body}\n\
  23. end\n\
  24. ";
  25. exports.scope = "lua";
  26. });
  27. (function() {
  28. ace.require(["ace/snippets/lua"], function(m) {
  29. if (typeof module == "object" && typeof exports == "object" && module) {
  30. module.exports = m;
  31. }
  32. });
  33. })();