summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-06-25 19:13:56 +0000
committerRobert Pösel <robyer@seznam.cz>2013-06-25 19:13:56 +0000
commitc3bf2345b385f15a5cd8d04478abdaf6f8468712 (patch)
treefd541ae52f5a9e1df52725c37ec960be93638f2d
parenta37e2d8a1144d31f44977e4ccdb036d06ed0254d (diff)
Lpgen: Added few more crap filtering for rc files.
git-svn-id: http://svn.miranda-ng.org/main/trunk@5131 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--tools/lpgen/lpgen.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/lpgen/lpgen.js b/tools/lpgen/lpgen.js
index 963d91625a..310496a524 100644
--- a/tools/lpgen/lpgen.js
+++ b/tools/lpgen/lpgen.js
@@ -415,11 +415,14 @@ function ParseFiles (filelist,stringsarray, parsefunction) {
//*.RC files line-by-line parser for RC_File, return result into "array"
function ParseRCFile(FileTextVar,array) {
- var find=/^(?!\/{1,2})\s*(?:CONTROL|(?:DEF)?PUSHBUTTON|[LRC]TEXT|AUTORADIOBUTTON|GROUPBOX|(?:AUTO)?CHECKBOX|CAPTION|MENUITEM|POPUP)\s*"((?:(?:""[^"]+?"")*[^"]*?)*)"\s*?(,|$|\\)/mgi;
+ var find=/^(?!\/{1,2})\s*(CONTROL|(?:DEF)?PUSHBUTTON|[LRC]TEXT|AUTORADIOBUTTON|GROUPBOX|(?:AUTO)?CHECKBOX|CAPTION|MENUITEM|POPUP)\s*"((?:(?:""[^"]+?"")*[^"]*?)*)"\s*?(,|$|\\)/mgi;
//now make a job, till end of matching regexp
while ((string = find.exec(FileTextVar)) != null) {
// check for some garbage like "List1","Tab1" etc. in *.rc files, we do not need this.
- onestring=string[1].replace(/^((List|Tab|Tree|Spin|Custom|Slider|DateTimePicker|Radio|Check|HotKey|Progress)\d)|(whiterect)$/g,"");
+ onestring=string[2].replace(/^((List|Tab|Tree|Spin|Custom|Slider|DateTimePicker|Radio|Check|HotKey|Progress)\d)|(whiterect)$/g,"");
+ // remove some popup menu craps
+ if (string[1]=="POPUP")
+ onestring=onestring.replace(/^([a-zA-Z]*menu)|([A-Z][a-z]+[A-Z][a-z]*|dummy)$/g,"");
//if there is double "", replace with single one
onestring=onestring.replace(/\"{2}/g,"\"");
//check result. If it does not match [a-z] (no any letter in results, such as "..." or "->") it's a crap, break further actions.