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