summaryrefslogtreecommitdiff
path: root/tools/lpgen
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lpgen')
-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