71bbf2d4b6293b54d672c2812fa8323e.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. ace.define("ace/mode/ini_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from tool\tm bundles\ini.tmbundle\Syntaxes\Ini.plist (uuid: ) */
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var escapeRe = "\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})";
  6. var IniHighlightRules = function () {
  7. this.$rules = {
  8. start: [{
  9. token: 'punctuation.definition.comment.ini',
  10. regex: '#.*',
  11. push_: [{
  12. token: 'comment.line.number-sign.ini',
  13. regex: '$|^',
  14. next: 'pop'
  15. }, {
  16. defaultToken: 'comment.line.number-sign.ini'
  17. }]
  18. }, {
  19. token: 'punctuation.definition.comment.ini',
  20. regex: ';.*',
  21. push_: [{
  22. token: 'comment.line.semicolon.ini',
  23. regex: '$|^',
  24. next: 'pop'
  25. }, {
  26. defaultToken: 'comment.line.semicolon.ini'
  27. }]
  28. }, {
  29. token: ['keyword.other.definition.ini', 'text', 'punctuation.separator.key-value.ini'],
  30. regex: '\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)'
  31. }, {
  32. token: ['punctuation.definition.entity.ini', 'constant.section.group-title.ini', 'punctuation.definition.entity.ini'],
  33. regex: '^(\\[)(.*?)(\\])'
  34. }, {
  35. token: 'punctuation.definition.string.begin.ini',
  36. regex: "'",
  37. push: [{
  38. token: 'punctuation.definition.string.end.ini',
  39. regex: "'",
  40. next: 'pop'
  41. }, {
  42. token: "constant.language.escape",
  43. regex: escapeRe
  44. }, {
  45. defaultToken: 'string.quoted.single.ini'
  46. }]
  47. }, {
  48. token: 'punctuation.definition.string.begin.ini',
  49. regex: '"',
  50. push: [{
  51. token: "constant.language.escape",
  52. regex: escapeRe
  53. }, {
  54. token: 'punctuation.definition.string.end.ini',
  55. regex: '"',
  56. next: 'pop'
  57. }, {
  58. defaultToken: 'string.quoted.double.ini'
  59. }]
  60. }]
  61. };
  62. this.normalizeRules();
  63. };
  64. IniHighlightRules.metaData = {
  65. fileTypes: ['ini', 'conf'],
  66. keyEquivalent: '^~I',
  67. name: 'Ini',
  68. scopeName: 'source.ini'
  69. };
  70. oop.inherits(IniHighlightRules, TextHighlightRules);
  71. exports.IniHighlightRules = IniHighlightRules;
  72. });
  73. ace.define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  74. var oop = require("../../lib/oop");
  75. var Range = require("../../range").Range;
  76. var BaseFoldMode = require("./fold_mode").FoldMode;
  77. var FoldMode = exports.FoldMode = function () {
  78. };
  79. oop.inherits(FoldMode, BaseFoldMode);
  80. (function () {
  81. this.foldingStartMarker = /^\s*\[([^\])]*)]\s*(?:$|[;#])/;
  82. this.getFoldWidgetRange = function (session, foldStyle, row) {
  83. var re = this.foldingStartMarker;
  84. var line = session.getLine(row);
  85. var m = line.match(re);
  86. if (!m)
  87. return;
  88. var startName = m[1] + ".";
  89. var startColumn = line.length;
  90. var maxRow = session.getLength();
  91. var startRow = row;
  92. var endRow = row;
  93. while (++row < maxRow) {
  94. line = session.getLine(row);
  95. if (/^\s*$/.test(line))
  96. continue;
  97. m = line.match(re);
  98. if (m && m[1].lastIndexOf(startName, 0) !== 0)
  99. break;
  100. endRow = row;
  101. }
  102. if (endRow > startRow) {
  103. var endColumn = session.getLine(endRow).length;
  104. return new Range(startRow, startColumn, endRow, endColumn);
  105. }
  106. };
  107. }).call(FoldMode.prototype);
  108. });
  109. ace.define("ace/mode/ini",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ini_highlight_rules","ace/mode/folding/ini"], function(require, exports, module){"use strict";
  110. var oop = require("../lib/oop");
  111. var TextMode = require("./text").Mode;
  112. var IniHighlightRules = require("./ini_highlight_rules").IniHighlightRules;
  113. var FoldMode = require("./folding/ini").FoldMode;
  114. var Mode = function () {
  115. this.HighlightRules = IniHighlightRules;
  116. this.foldingRules = new FoldMode();
  117. this.$behaviour = this.$defaultBehaviour;
  118. };
  119. oop.inherits(Mode, TextMode);
  120. (function () {
  121. this.lineCommentStart = ";";
  122. this.blockComment = null;
  123. this.$id = "ace/mode/ini";
  124. }).call(Mode.prototype);
  125. exports.Mode = Mode;
  126. }); (function() {
  127. ace.require(["ace/mode/ini"], function(m) {
  128. if (typeof module == "object" && typeof exports == "object" && module) {
  129. module.exports = m;
  130. }
  131. });
  132. })();