summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2018-05-23 18:18:49 +0300
committerdartraiden <wowemuh@gmail.com>2018-05-23 18:18:49 +0300
commit40001ac618afd1c96d2bdbca4dc02f675e90ccdf (patch)
treebfb65a280bfc6864b154e7eafec2b20a434ad25d /tools
parentc081ab4395c72e319399c01e1ded10e1b8929425 (diff)
lpgen.js: add TranslateA_LP() and TranslateW_LP() support
Diffstat (limited to 'tools')
-rw-r--r--tools/lpgen/lpgen.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lpgen/lpgen.js b/tools/lpgen/lpgen.js
index 3eb502345c..85077cd56e 100644
--- a/tools/lpgen/lpgen.js
+++ b/tools/lpgen/lpgen.js
@@ -505,7 +505,7 @@ function ParseRCFile(FileTextVar, array) {
}
}
-//Source files C++ (*.h,*.c,*.cpp) and *.pas,*.dpr,*.inc (Pascal) multiline parser for translations using LPGEN() LPGENT() TranslateT() Translate() _T() TranslateW()
+//Source files C++ (*.h,*.c,*.cpp) and *.pas,*.dpr,*.inc (Pascal) multiline parser for translations using LPGEN(), LPGENT(), LPGENW(), Translate(), TranslateT(), TranslateW(), _T(), TranslateA_LP(), TranslateW_LP()
function ParseSourceFile(FileTextVar, array) {
var string = "",
onestring = "",
@@ -515,9 +515,9 @@ function ParseSourceFile(FileTextVar, array) {
stringtolangpack = "",
clearstring = "";
//not store ?: functions LPGEN or LPGENT? or Translate(T or W) or _T, than any unnecessary space \s, than not stored ?: "(" followed by ' or " (stored and used as \1) than \S\s - magic with multiline capture, ending with not stored ?= \1 (we get " or ' after "("), than none or few spaces \x20 followed by )/m=multiline g=global
- //var find= /(?:LPGENT?|Translate[TW]?|_T)(?:\s*?\(\s*?L?\s*)(['"])([\S\s]*?)(?=\1,?\x20*?(?:tmp)?\))/mg;
+ //var find= /(?:LPGEN[TW]?|Translate[TW]?||Translate[AW]_LP|_T)(?:\s*?\(\s*?L?\s*)(['"])([\S\s]*?)(?=\1,?\x20*?(?:tmp)?\))/mg;
//comment previous line and uncomment following line to output templates without _T() function in source files. Too many garbage from _T()..
- var find = /(?:LPGEN[TW]?|Translate[TW]?)(?:\s*?\(\s*?L?\s*)((?:(?:"[^"\\]*(?:\\[\S\s][^"\\]*)*")\s*)*)(?:\s*?,?\s*?(?:tmp)?\))/gm;
+ var find = /(?:LPGEN[TW]?|Translate[TW]?|Translate[AW]_LP)(?:\s*?\(\s*?L?\s*)((?:(?:"[^"\\]*(?:\\[\S\s][^"\\]*)*")\s*)*)(?:\s*?,?\s*?(?:tmp)?\))/gm;
//now make a job, till end of matching regexp
while ((string = find.exec(FileTextVar)) !== null) {
//first, init empty var