From 40001ac618afd1c96d2bdbca4dc02f675e90ccdf Mon Sep 17 00:00:00 2001 From: dartraiden Date: Wed, 23 May 2018 18:18:49 +0300 Subject: lpgen.js: add TranslateA_LP() and TranslateW_LP() support --- tools/lpgen/lpgen.js | 6 +++--- 1 file 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 -- cgit v1.2.3