forked from XhmikosR/notepad2-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
/
lexlink.js
54 lines (52 loc) · 1.13 KB
/
lexlink.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
/*
Comment lexer modules from "scintilla\src\Catalogue.cxx" not used by Notepad2
(c) Florian Balmer 2011
*/
var lex = new Array(
"lmAHK",
"lmAsm",
"lmAU3",
"lmAVS",
"lmBash",
"lmBatch",
"lmCmake",
"lmCoffeeScript",
"lmConf",
"lmCPP",
"lmCss",
"lmDiff",
"lmHTML",
"lmInno",
"lmLatex",
"lmLua",
"lmMake",
"lmMarkdown",
"lmNsis",
"lmNull",
"lmPascal",
"lmPerl",
"lmPowerShell",
"lmProps",
"lmPython",
"lmRuby",
"lmSQL",
"lmTCL",
"lmVB",
"lmVBScript",
"lmXML",
"lmYAML",
"lmVHDL"
);
var fso = new ActiveXObject("Scripting.FileSystemObject");
var fh = fso.OpenTextFile("scintilla\\src\\Catalogue.cxx",1,0);
if (!fh.AtEndOfStream) {
var str = fh.ReadAll();
str = str.replace(
/^(\s*)\/\/(LINK_LEXER)/gim,
"$1$2");
var re = new RegExp("^(\\s*)(LINK_LEXER\\((?!"+lex.join("|")+")\\w+\\);)","gim");
str = str.replace(re,"$1//$2");
fh.Close();
var fh = fso.OpenTextFile("scintilla\\src\\Catalogue.cxx",2,0);
fh.Write(str);
}