From 82570bd5af4c6bcd2eeb6f4d356a56770bab65ef Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 9 Jan 2015 10:38:37 +0100 Subject: [PATCH] Fix build after commit 9d7b27f5bf44a46707e6d50ebf51ecf73f91dd1b in qtdeclarative The commit integrates the .pragma and .import parsing in JavaScript files directly into the lexer. Previously the QML engine had a separate function for parsing those directives and replacing them with whitespace in the source. Similarly the code here tried to do the same. Fortunately this is not necessary anymore as the lexer now understands those directives and unless told otherwise will simply ignore them. Change-Id: If9888deb2c82a15d1727f4254d897fc9e7bcb832 Reviewed-by: Oswald Buddenhagen Reviewed-by: Simon Hausmann --- src/linguist/lupdate/qdeclarative.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/linguist/lupdate/qdeclarative.cpp b/src/linguist/lupdate/qdeclarative.cpp index bbca7a0..315029d 100644 --- a/src/linguist/lupdate/qdeclarative.cpp +++ b/src/linguist/lupdate/qdeclarative.cpp @@ -468,24 +468,6 @@ static bool load(Translator &translator, const QString &filename, ConversionData code = ts.readAll(); } - if (! qmlMode) { - // fetch the optional pragma directives for Javascript files. - - Lexer lex(/*engine=*/ 0); - HasDirectives directives(&lex); - lex.setCode(code, 1, qmlMode); - if (lex.scanDirectives(&directives)) { - if (directives()) { - // replace directives with white space characters - const int tokenOffset = directives.end(); - for (int i = 0; i < tokenOffset; ++i) { - if (! code.at(i).isSpace()) - code[i] = QLatin1Char(' '); - } - } - } - } - Engine driver; Parser parser(&driver); -- 2.7.4