b9963f909afff9cb4e6dd95bf5bc20c4.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ace.define("ace/mode/doc_comment_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 DocCommentHighlightRules = function () {
  5. this.$rules = {
  6. "start": [{
  7. token: "comment.doc.tag",
  8. regex: "@[\\w\\d_]+" // TODO: fix email addresses
  9. },
  10. DocCommentHighlightRules.getTagRule(),
  11. {
  12. defaultToken: "comment.doc",
  13. caseInsensitive: true
  14. }]
  15. };
  16. };
  17. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  18. DocCommentHighlightRules.getTagRule = function (start) {
  19. return {
  20. token: "comment.doc.tag.storage.type",
  21. regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  22. };
  23. };
  24. DocCommentHighlightRules.getStartRule = function (start) {
  25. return {
  26. token: "comment.doc",
  27. regex: "\\/\\*(?=\\*)",
  28. next: start
  29. };
  30. };
  31. DocCommentHighlightRules.getEndRule = function (start) {
  32. return {
  33. token: "comment.doc",
  34. regex: "\\*\\/",
  35. next: start
  36. };
  37. };
  38. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  39. });
  40. ace.define("ace/mode/edifact_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  41. var oop = require("../lib/oop");
  42. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  43. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  44. var EdifactHighlightRules = function () {
  45. var header = ("UNH");
  46. var segment = ("ADR|AGR|AJT|ALC|ALI|APP|APR|ARD|ARR|ASI|ATT|AUT|" +
  47. "BAS|BGM|BII|BUS|" +
  48. "CAV|CCD|CCI|CDI|CDS|CDV|CED|CIN|CLA|CLI|CMP|CNI|CNT|COD|COM|COT|CPI|CPS|CPT|CST|CTA|CUX|" +
  49. "DAM|DFN|DGS|DII|DIM|DLI|DLM|DMS|DOC|DRD|DSG|DSI|DTM|" +
  50. "EDT|EFI|ELM|ELU|ELV|EMP|EQA|EQD|EQN|ERC|ERP|EVE|FCA|FII|FNS|FNT|FOR|FSQ|FTX|" +
  51. "GDS|GEI|GID|GIN|GIR|GOR|GPO|GRU|HAN|HYN|ICD|IDE|IFD|IHC|IMD|IND|INP|INV|IRQ|" +
  52. "LAN|LIN|LOC|MEA|MEM|MKS|MOA|MSG|MTD|NAD|NAT|" +
  53. "PAC|PAI|PAS|PCC|PCD|PCI|PDI|PER|PGI|PIA|PNA|POC|PRC|PRI|PRV|PSD|PTY|PYT|" +
  54. "QRS|QTY|QUA|QVR|" +
  55. "RCS|REL|RFF|RJL|RNG|ROD|RSL|RTE|" +
  56. "SAL|SCC|SCD|SEG|SEL|SEQ|SFI|SGP|SGU|SPR|SPS|STA|STC|STG|STS|" +
  57. "TAX|TCC|TDT|TEM|TMD|TMP|TOD|TPL|TRU|TSR|" +
  58. "UNB|UNZ|UNT|UGH|UGT|UNS|" +
  59. "VLI");
  60. var header = ("UNH");
  61. var buildinConstants = ("null|Infinity|NaN|undefined");
  62. var langClasses = ("");
  63. var keywords = ("BY|SE|ON|INV|JP|UNOA");
  64. var keywordMapper = this.createKeywordMapper({
  65. "variable.language": "this",
  66. "keyword": keywords,
  67. "entity.name.segment": segment,
  68. "entity.name.header": header,
  69. "constant.language": buildinConstants,
  70. "support.function": langClasses
  71. }, "identifier");
  72. this.$rules = {
  73. "start": [
  74. {
  75. token: "punctuation.operator",
  76. regex: "\\+.\\+"
  77. }, {
  78. token: "constant.language.boolean",
  79. regex: "(?:true|false)\\b"
  80. }, {
  81. token: keywordMapper,
  82. regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  83. }, {
  84. token: "keyword.operator",
  85. regex: "\\+"
  86. }, {
  87. token: "punctuation.operator",
  88. regex: "\\:|'"
  89. }, {
  90. token: "identifier",
  91. regex: "\\:D\\:"
  92. }
  93. ]
  94. };
  95. this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
  96. };
  97. EdifactHighlightRules.metaData = { fileTypes: ['edi'],
  98. keyEquivalent: '^~E',
  99. name: 'Edifact',
  100. scopeName: 'source.edifact' };
  101. oop.inherits(EdifactHighlightRules, TextHighlightRules);
  102. exports.EdifactHighlightRules = EdifactHighlightRules;
  103. });
  104. ace.define("ace/mode/edifact",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/edifact_highlight_rules"], function(require, exports, module){"use strict";
  105. var oop = require("../lib/oop");
  106. var TextMode = require("./text").Mode;
  107. var EdifactHighlightRules = require("./edifact_highlight_rules").EdifactHighlightRules;
  108. var Mode = function () {
  109. this.HighlightRules = EdifactHighlightRules;
  110. };
  111. oop.inherits(Mode, TextMode);
  112. (function () {
  113. this.$id = "ace/mode/edifact";
  114. this.snippetFileId = "ace/snippets/edifact";
  115. }).call(Mode.prototype);
  116. exports.Mode = Mode;
  117. }); (function() {
  118. ace.require(["ace/mode/edifact"], function(m) {
  119. if (typeof module == "object" && typeof exports == "object" && module) {
  120. module.exports = m;
  121. }
  122. });
  123. })();