-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathlexlink.js
39 lines (37 loc) · 885 Bytes
/
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
/*
Comment lexer modules from "scintilla\src\Catalogue.cxx" not used by Notepad2
(c) Florian Balmer 2011
*/
var lex = new Array(
"lmAsm",
"lmBatch",
"lmConf",
"lmCPP",
"lmCss",
"lmDiff",
"lmHTML",
"lmMake",
"lmNull",
"lmPascal",
"lmPerl",
"lmPowerShell",
"lmProps",
"lmPython",
"lmSQL",
"lmVB",
"lmVBScript",
"lmXML"
);
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);
}