this.getTokenizer = function() {
if (!this.$tokenizer) {
this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig);
this.$tokenizer = new Tokenizer(this.$highlightRules.getRules());
}
return this.$tokenizer;
};define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var cql_highlight_rules = require("./cql_highlight_rules").cql_highlight_rules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Range = require("../range").Range;
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
this.HighlightRules = cql_highlight_rules;
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new CstyleBehaviour();
this.foldingRules = new CStyleFoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
var endState = tokenizedLine.state;
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent;
}
if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/);
if (match) {
indent += tab;
}
} else if (state == "doc-start") {
if (endState == "start") {
return "";
}
var match = line.match(/^\s*(\/?)\*/);
if (match) {
if (match[1]) {
indent += " ";
}
indent += "* ";
}
}
return indent;
};
this.checkOutdent = function(state, line, input) {
return this.$outdent.checkOutdent(line, input);
};
this.autoOutdent = function(state, doc, row) {
this.$outdent.autoOutdent(doc, row);
};
this.$id = "ace/mode/cql";
}).call(Mode.prototype);
exports.Mode = Mode;
});define("ace/mode/cql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cql_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
define("ace/mode/cql_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";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CQLHighlightRules = function() {
var escapeRe = "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)";
this.$rules = {
"start" : [
{
token : "comment",
regex : "//$",
next : "start"
},
{
token : "comment",
regex : "//",
next : "singleLineComment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment"
},
{
token : "string.single", // character
regex : "'(?:" + escapeRe + "|.)'"
},
{
token : "string.start",
regex : '\'',
stateName: "qstring",
next: [
{ token: "string.single", regex: /\\\s*$/, next: "qstring" },
{ token: "constant.language.escape", regex: escapeRe },
{ token: "constant.language.escape", regex: /%[^'"\\]/ },
{ token: "string.end", regex: '\'|$', next: "start" },
{ defaultToken: "string.single"}
]
},
{
token : "string.double", // character
regex : "'(?:" + escapeRe + "|.)'"
},
{
token : "namedexpression.start",
regex : '"',
stateName: "qqstring",
next: [
{ token: "string.double", regex: /\\\s*$/, next: "qqstring" },
{ token: "constant.language.escape", regex: escapeRe },
{ token: "constant.language.escape", regex: /%[^'"\\]/ },
{ token: "namedexpression.end", regex: '"|$', next: "start" },
{ defaultToken: "string.double"}
]
},
{
token: "constant.date",
regex: "@\\b[0-9][0-9][0-9][0-9](\\-[0-1][0-9](\\-[0-3][0-9](T[0-2][0-9](\\:[0-5][0-9](\\:[0-5][0-9](\\.[0-9][0-9]?[0-9]?(Z|((\\+|\\-)[0-2][0-9](\\:[0-5][0-9])?))?)?)?)?)?)?)?\\b"
},
{
token: "constant.time",
regex: "@\\bT[0-2][0-9](\\:[0-5][0-9](\\:[0-5][0-9](\\.[0-9][0-9]?[0-9]?(Z|((\\+|\\-)[0-2][0-9](\\:[0-5][0-9])?))?)?)?)?\\b"
},
{
token: "constant.numeric",
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\b"
},
{
token: "constant.language",
regex: "\\b(true|false|null)\\b"
},
{
token : "paren.lparen",
regex : "[[({]"
},
{
token : "paren.rparen",
regex : "[\\])}]"
},
{
token : "text",
regex : "\\s+"
},
{
token : "keyword.declarations",
regex : "\\b(library|using|include|version|called|parameter|default|valueset|codesystems?|display|public|private|context +(Patient|Population)|define( +function +([^\\(]+))?)\\b"
},
{
token : "operator.temporal",
regex : "\\bsame +((year|month|day|hour|minute|second|millisecond) +)?(or +before|or +after|as)\\b"
},
{
token : "operator.temporal",
regex : "\\b(properly +)?within\\s+(\\d+)\\s+(year|month|day|hour|minute|second|millisecond)s? +of\\b"
},
{
token : "operator.temporal",
regex : "\\b(starts|ends|occurs|meets|overlaps|(properly +)?(contains|includes|during|included +in)|before|after|(start|end)( +of)?)\\b"
},
{
token : "operator.temporal",
regex : "\\b(year|month|day|hour|minute|second|millisecond)s?( +or +(less|more))? (before|after)\\b"
},
{
token : "operator.logical",
regex : "\\b(and|or|xor|not)\\b"
},
{
token : "operator.nullological",
regex : "\\b(Coalesce|is +null|is +not +null)\\b"
},
{
token : "operator.type",
regex : "\\b(cast|as|convert|to|is|ToBoolean|ToConcept|ToDateTime|ToDecimal|ToInteger|ToQuantity|ToString|ToTime)\\b"
},
{
token : "operator.comparison",
regex : "=|<|>|matches"
},
{
token : "operator.comparison",
regex : "\\b(properly +)?between\\b"
},
{
token : "operator.arithmetic",
regex : "\\+|\\-|\\*|\\/|\\^"
},
{
token : "operator.arithmetic",
regex : "\\b(Abs|Ceiling|div|Floor|Log|Ln|maximum|minimum|mod|predecessor +of|Round|successor +of|Truncate)\\b"
},
{
token : "operator.string",
regex : "\\b(Combine|Length|Lower|PositionOf|Split|Substring|Upper)\\b"
},
{
token : "operator.datetime",
regex : "\\b(DateTime|Now|TimeOfDay|Today)\\b"
},
{
token : "operator.datetime",
regex : "\\b(year|month|day|hour|minute|second|millisecond|timezone|date|time) +from\\b"
},
{
token : "operator.datetime",
regex : "\\b(years|months|days|hours|minutes|seconds|milliseconds) +between\\b"
},
{
token : "operator.datetime",
regex : "\\b(duration|difference) +in +(years|months|days|hours|minutes|seconds|milliseconds) +of\\b"
},
{
token : "operator.datetime",
regex : "\\b(years?|months?|days?|hours?|minutes?|seconds?|milliseconds?)\\b"
},
{
token : "operator.datetime",
regex : "\\b(Calculate)?Age(In(Years|Months|Days|Hours|Minutes|Seconds))?(At)?\\b"
},
{
token : "operator.interval",
regex : "\\b(collapse|width +of)\\b"
},
{
token : "operator.list",
regex : "\\b(all|distinct|exists|expand|First|IndexOf|Last|Length|singleton +from)\\b"
},
{
token : "operator.intervalOrList",
regex : "\\b(contains|except|in|intersect|union)\\b"
},
{
token : "operator.aggregate",
regex : "\\b(AllTrue|AnyTrue|Avg|Count|Max|Min|Median|Mode|PopulationStdDev|PopulationVariance|StdDev|Sum|Variance)\\b"
},
{
token : "control",
regex : "\\b(if|then|else|case|when)\\b"
},
{
token : "control.query",
regex : "\\b(with|without|where|return|such that|sort( +asc(ending)?|desc(ending)?)?( +by)|asc(ending)|desc(ending))\\b"
},
{
token : "support.type",
regex : "\\b(Any|Boolean|Code|Concept|DateTime|Decimal|Integer|Interval|List|Quantity|String|Time|Tuple)\\b"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : ".*?\\*\\/",
next : "start"
}, {
token : "comment", // comment spanning whole line
regex : ".+"
}
],
"singleLineComment" : [
{
token : "comment",
regex : /\\$/,
next : "singleLineComment"
}, {
token : "comment",
regex : /$/,
next : "start"
}, {
defaultToken: "comment"
}
],
"directive" : [
{
token : "constant.other.multiline",
regex : /\\/
},
{
token : "constant.other.multiline",
regex : /.*\\/
},
{
token : "constant.other",
regex : "\\s*<.+?>",
next : "start"
},
{
token : "constant.other", // single line
regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',
next : "start"
},
{
token : "constant.other", // single line
regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next : "start"
},
{
token : "constant.other",
regex : /[^\\\/]+/,
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
this.normalizeRules();
};
oop.inherits(CQLHighlightRules, TextHighlightRules);
exports CQLHighlightRules = CQLHighlightRules;
});define(function(require, exports, module) {--You received this message because you are subscribed to the Google Groups "Ajax.org Cloud9 Editor (Ace)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ace-discuss...@googlegroups.com.
To post to this group, send email to ace-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/ace-discuss.
For more options, visit https://groups.google.com/d/optout.