95722ce261fad0a28f370f9042ac8acd.js 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ace.define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  4. var CobolHighlightRules = function () {
  5. var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" +
  6. "AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" +
  7. "ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" +
  8. "TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" +
  9. "UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" +
  10. "PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" +
  11. "CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" +
  12. "COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" +
  13. "RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" +
  14. "DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" +
  15. "ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" +
  16. "EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT";
  17. var builtinConstants = ("true|false|null");
  18. var builtinFunctions = ("count|min|max|avg|sum|rank|now|coalesce|main");
  19. var keywordMapper = this.createKeywordMapper({
  20. "support.function": builtinFunctions,
  21. "keyword": keywords,
  22. "constant.language": builtinConstants
  23. }, "identifier", true);
  24. this.$rules = {
  25. "start": [{
  26. token: "comment",
  27. regex: "\\*.*$"
  28. }, {
  29. token: "string",
  30. regex: '".*?"'
  31. }, {
  32. token: "string",
  33. regex: "'.*?'"
  34. }, {
  35. token: "constant.numeric",
  36. regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  37. }, {
  38. token: keywordMapper,
  39. regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  40. }, {
  41. token: "keyword.operator",
  42. regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
  43. }, {
  44. token: "paren.lparen",
  45. regex: "[\\(]"
  46. }, {
  47. token: "paren.rparen",
  48. regex: "[\\)]"
  49. }, {
  50. token: "text",
  51. regex: "\\s+"
  52. }]
  53. };
  54. };
  55. oop.inherits(CobolHighlightRules, TextHighlightRules);
  56. exports.CobolHighlightRules = CobolHighlightRules;
  57. });
  58. ace.define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cobol_highlight_rules"], function(require, exports, module){"use strict";
  59. var oop = require("../lib/oop");
  60. var TextMode = require("./text").Mode;
  61. var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules;
  62. var Mode = function () {
  63. this.HighlightRules = CobolHighlightRules;
  64. this.$behaviour = this.$defaultBehaviour;
  65. };
  66. oop.inherits(Mode, TextMode);
  67. (function () {
  68. this.lineCommentStart = "*";
  69. this.$id = "ace/mode/cobol";
  70. }).call(Mode.prototype);
  71. exports.Mode = Mode;
  72. }); (function() {
  73. ace.require(["ace/mode/cobol"], function(m) {
  74. if (typeof module == "object" && typeof exports == "object" && module) {
  75. module.exports = m;
  76. }
  77. });
  78. })();