summaryrefslogtreecommitdiff
path: root/tools/lpgen/lpgen.js
diff options
context:
space:
mode:
authorBasil <basil@miranda-ng.org>2013-02-20 11:33:09 +0000
committerBasil <basil@miranda-ng.org>2013-02-20 11:33:09 +0000
commit02e5fe5cab2be215e20197711efa8cf0517fcc54 (patch)
treeaf5cd00b779c05c6956327e265c346bb06c765f6 /tools/lpgen/lpgen.js
parent1cee868c228c2754cb010ef3fcd02e7419fc0810 (diff)
- additional removal of comments from source code. Many useless lines now not included into templates. new RC engine with same behavior will be ready soon.
git-svn-id: http://svn.miranda-ng.org/main/trunk@3648 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'tools/lpgen/lpgen.js')
-rw-r--r--tools/lpgen/lpgen.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/lpgen/lpgen.js b/tools/lpgen/lpgen.js
index d31ef5214c..aeb4b29e40 100644
--- a/tools/lpgen/lpgen.js
+++ b/tools/lpgen/lpgen.js
@@ -464,8 +464,11 @@ function ParseSourceFile (SourceFile,array) {
//read file fully into var
allstrings=sourcefile_stream.ReadAll();
+ //remove all comments. The text starting with \\ (but not with ":\\" it's a links like http://miranda-ng.org/ and ")//" -there is one comment right after needed string)
+ //and remove multi-line comments, started with /* and ended with */
+ allstrings_without_comments=allstrings.replace(/(?:[^\):])(\/{2}.+?(?=$))|(\s\/\*[\S\s]+?\*\/)/mg,".")
//now make a job, till end of matching regexp
- while ((string = find.exec(allstrings)) != null) {
+ while ((string = find.exec(allstrings_without_comments)) != null) {
//first, init empty var
var string;
//replace newlines with "" in second [1] subregexp ([\S\s]*?), and Delphi newlines "'#13#10+" replace