forked from yokoyama-lab/R-WHILE_Syntax_Highlighter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rwhile.js
62 lines (49 loc) · 1.93 KB
/
rwhile.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
// defines the parent mode
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
// インデント機能
// var MatchingBraceOutdent = require(".matching_brace_outdent").MatchingBraceOutdent;
// defines the language specific highlighters and folding rules
var RwhileHighlightRules = require("./rwhile_highlight_rules").RwhileHighlightRules;
// var MyNewFoldMode = require("./folding/mynew").MyNewFoldMode;
var Mode = function() {
// set everything up
this.HighlightRules = RwhileHighlightRules;
// インデント機能
// this.$outdent = new MatchingBraceOutdent();
// 折り畳み機能
// this.foldingRules = new MyNewFoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
// special logic for indent/outdent.
// By default ace keeps indentation of previous line
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
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);
};
// create worker for live syntax checking
/*
this.createWorker = function(session) {
var worker = new WorkerClient(["ace"], "ace/mode/mynew_worker", "NewWorker");
worker.attachToDocument(session.getDocument());
worker.on("errors", function(e) {
session.setAnnotations(e.data);
});
return worker;
};
*/
}).call(Mode.prototype);
exports.Mode = Mode;
});