92917192eaffb1cf3cadaf985d3cc5d1.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. ace.define("ace/mode/abap_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
  2. * based on
  3. * " Vim ABAP syntax file
  4. * " Language: SAP - ABAP/R4
  5. * " Revision: 2.1
  6. * " Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
  7. * " Last Change: 2012 Oct 23
  8. */
  9. "use strict";
  10. var oop = require("../lib/oop");
  11. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  12. var AbapHighlightRules = function () {
  13. var keywordMapper = this.createKeywordMapper({
  14. "variable.language": "this",
  15. "keyword": "ADD ALIAS ALIASES ASCENDING ASSERT ASSIGN ASSIGNING AT BACK" +
  16. " CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" +
  17. " DATA DEFINE DEFINITION DEFERRED DELETE DESCENDING DESCRIBE DETAIL DIVIDE DO" +
  18. " ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" +
  19. " FETCH FIELDS FORM FORMAT FREE FROM FUNCTION" +
  20. " GENERATE GET" +
  21. " HIDE" +
  22. " IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION" +
  23. " LEAVE LIKE LINE LOAD LOCAL LOOP" +
  24. " MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY" +
  25. " ON OVERLAY OPTIONAL OTHERS" +
  26. " PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT" +
  27. " RAISE RANGES READ RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURN RETURNING ROLLBACK" +
  28. " SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS" +
  29. " TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES" +
  30. " UNASSIGN ULINE UNPACK UPDATE" +
  31. " WHEN WHILE WINDOW WRITE" +
  32. " OCCURS STRUCTURE OBJECT PROPERTY" +
  33. " CASTING APPEND RAISING VALUE COLOR" +
  34. " CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT" +
  35. " ID NUMBER FOR TITLE OUTPUT" +
  36. " WITH EXIT USING" +
  37. " INTO WHERE GROUP BY HAVING ORDER BY SINGLE" +
  38. " APPENDING CORRESPONDING FIELDS OF TABLE" +
  39. " LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" +
  40. " EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN",
  41. "constant.language": "TRUE FALSE NULL SPACE",
  42. "support.type": "c n i p f d t x string xstring decfloat16 decfloat34",
  43. "keyword.operator": "abs sign ceil floor trunc frac acos asin atan cos sin tan" +
  44. " abapOperator cosh sinh tanh exp log log10 sqrt" +
  45. " strlen xstrlen charlen numofchar dbmaxlen lines"
  46. }, "text", true, " ");
  47. var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|" +
  48. "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|" +
  49. "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|" +
  50. "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|" +
  51. "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|" +
  52. "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)" +
  53. "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|" +
  54. "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|" +
  55. "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|" +
  56. "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|" +
  57. "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|" +
  58. "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|" +
  59. "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|" +
  60. "IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)";
  61. this.$rules = {
  62. "start": [
  63. { token: "string", regex: "`", next: "string" },
  64. { token: "string", regex: "'", next: "qstring" },
  65. { token: "doc.comment", regex: /^\*.+/ },
  66. { token: "comment", regex: /".+$/ },
  67. { token: "invalid", regex: "\\.{2,}" },
  68. { token: "keyword.operator", regex: /\W[\-+%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/ },
  69. { token: "paren.lparen", regex: "[\\[({]" },
  70. { token: "paren.rparen", regex: "[\\])}]" },
  71. { token: "constant.numeric", regex: "[+-]?\\d+\\b" },
  72. { token: "variable.parameter", regex: /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/ },
  73. { token: "keyword", regex: compoundKeywords },
  74. { token: "variable.parameter", regex: /\w+-\w[\-\w]*/ },
  75. { token: keywordMapper, regex: "\\b\\w+\\b" },
  76. { caseInsensitive: true }
  77. ],
  78. "qstring": [
  79. { token: "constant.language.escape", regex: "''" },
  80. { token: "string", regex: "'", next: "start" },
  81. { defaultToken: "string" }
  82. ],
  83. "string": [
  84. { token: "constant.language.escape", regex: "``" },
  85. { token: "string", regex: "`", next: "start" },
  86. { defaultToken: "string" }
  87. ]
  88. };
  89. };
  90. oop.inherits(AbapHighlightRules, TextHighlightRules);
  91. exports.AbapHighlightRules = AbapHighlightRules;
  92. });
  93. ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
  94. var oop = require("../../lib/oop");
  95. var BaseFoldMode = require("./fold_mode").FoldMode;
  96. var Range = require("../../range").Range;
  97. var FoldMode = exports.FoldMode = function () { };
  98. oop.inherits(FoldMode, BaseFoldMode);
  99. (function () {
  100. this.getFoldWidgetRange = function (session, foldStyle, row) {
  101. var range = this.indentationBlock(session, row);
  102. if (range)
  103. return range;
  104. var re = /\S/;
  105. var line = session.getLine(row);
  106. var startLevel = line.search(re);
  107. if (startLevel == -1 || line[startLevel] != "#")
  108. return;
  109. var startColumn = line.length;
  110. var maxRow = session.getLength();
  111. var startRow = row;
  112. var endRow = row;
  113. while (++row < maxRow) {
  114. line = session.getLine(row);
  115. var level = line.search(re);
  116. if (level == -1)
  117. continue;
  118. if (line[level] != "#")
  119. break;
  120. endRow = row;
  121. }
  122. if (endRow > startRow) {
  123. var endColumn = session.getLine(endRow).length;
  124. return new Range(startRow, startColumn, endRow, endColumn);
  125. }
  126. };
  127. this.getFoldWidget = function (session, foldStyle, row) {
  128. var line = session.getLine(row);
  129. var indent = line.search(/\S/);
  130. var next = session.getLine(row + 1);
  131. var prev = session.getLine(row - 1);
  132. var prevIndent = prev.search(/\S/);
  133. var nextIndent = next.search(/\S/);
  134. if (indent == -1) {
  135. session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
  136. return "";
  137. }
  138. if (prevIndent == -1) {
  139. if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
  140. session.foldWidgets[row - 1] = "";
  141. session.foldWidgets[row + 1] = "";
  142. return "start";
  143. }
  144. }
  145. else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
  146. if (session.getLine(row - 2).search(/\S/) == -1) {
  147. session.foldWidgets[row - 1] = "start";
  148. session.foldWidgets[row + 1] = "";
  149. return "";
  150. }
  151. }
  152. if (prevIndent != -1 && prevIndent < indent)
  153. session.foldWidgets[row - 1] = "start";
  154. else
  155. session.foldWidgets[row - 1] = "";
  156. if (indent < nextIndent)
  157. return "start";
  158. else
  159. return "";
  160. };
  161. }).call(FoldMode.prototype);
  162. });
  163. ace.define("ace/mode/abap",["require","exports","module","ace/mode/abap_highlight_rules","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/lib/oop"], function(require, exports, module){"use strict";
  164. var Rules = require("./abap_highlight_rules").AbapHighlightRules;
  165. var FoldMode = require("./folding/coffee").FoldMode;
  166. var Range = require("../range").Range;
  167. var TextMode = require("./text").Mode;
  168. var oop = require("../lib/oop");
  169. function Mode() {
  170. this.HighlightRules = Rules;
  171. this.foldingRules = new FoldMode();
  172. }
  173. oop.inherits(Mode, TextMode);
  174. (function () {
  175. this.lineCommentStart = '"';
  176. this.getNextLineIndent = function (state, line, tab) {
  177. var indent = this.$getIndent(line);
  178. return indent;
  179. };
  180. this.$id = "ace/mode/abap";
  181. }).call(Mode.prototype);
  182. exports.Mode = Mode;
  183. }); (function() {
  184. ace.require(["ace/mode/abap"], function(m) {
  185. if (typeof module == "object" && typeof exports == "object" && module) {
  186. module.exports = m;
  187. }
  188. });
  189. })();