forked from ajaxorg/ace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic.js
40 lines (32 loc) · 1.15 KB
/
basic.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var BasicHighlightRules = require("./basic_highlight_rules").BasicHighlightRules;
var FoldMode = require("./folding/basic").FoldMode;
var Mode = function() {
this.HighlightRules = BasicHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
this.indentKeywords = this.foldingRules.indentKeywords;
};
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = ["REM"];
this.getMatching = function(session, row, column, tokenRange) {
if (row == undefined) {
var pos = session.selection.lead;
column = pos.column;
row = pos.row;
}
if (tokenRange == undefined)
tokenRange = true;
var startToken = session.getTokenAt(row, column);
if (startToken) {
var val = startToken.value.toLowerCase();
if (val in this.indentKeywords)
return this.foldingRules.basicBlock(session, row, column, tokenRange);
}
};
this.$id = "ace/mode/basic";
}).call(Mode.prototype);
exports.Mode = Mode;