aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlmin/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* sources: Add missing override and remove redundant virtualAlexander Volkov2017-02-231-5/+5
| | | | | | | Change-Id: I48e26b1491024d41ebf75d40f0d1a7e9a1b20f22 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Set Qt version on toolsFriedemann Kleint2016-11-091-0/+1
| | | | | Change-Id: I21d77b2eba7107528fc00db0cf5d87f8347b63be Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* tools: replace 'foreach' with 'range for'Anton Kudryavtsev2016-08-201-1/+1
| | | | | | | | | Mark some local variables or parameters as const to prevent detach()'ing. Use qAsConst where is not possible mark as const. Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Use QStringRef in a bunch of places.wip/dbusSérgio Martins2015-10-181-1/+1
| | | | | | | Done automatically with clazy static analyzer. Change-Id: Ia0cf8fa24331ab102a3c3c30c2aa92ef1ba772e2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Tools: Fix single-character string literals.Friedemann Kleint2015-10-131-8/+12
| | | | | | | Use character literals where applicable. Change-Id: I55679dcc13c4c79567712c0dfaaabc2b84fee010 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Clean up JS .import/.pragma directive scanningSimon Hausmann2015-01-081-4/+10
| | | | | | | | | | | There's a scanner in QQmlJS::Lexer::scanDirectives that can parse those, so let's get rid of extra parser that operates on a string. Instead this way we can do the scanning all in one shot, avoid detaching a copy of the source code string and (most importantly) bring the parser closer to the copy in Qt Creator, which uses the directives approach to extract imports and pragma. Change-Id: Iff6eb8d91a45d8a70f383f953115692be48259de Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Merge branch 'stable' into devGunnar Sletta2013-01-171-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | | | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* | Fix invalid compression in qmlminLars Knoll2012-12-111-7/+1
|/ | | | | | | | | qmlmin could compress identifiers in an invalid way if it contained special chars that would get expanded to unicode escape sequences Change-Id: I35b3ba01f68b69b34c4cd19616afb8b4b4cd6fa3 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Accept missing semicolon after do-while statement.Erik Verbruggen2012-11-261-2/+4
| | | | | | | | | Although not valid according to ECMA 5.1, both JSC and V8 accept a missing semicolon after a do-while loop. (Both JSC and V8 do not do this through automatic semicolon insertion, but handle it as a special case.) Change-Id: Iff2b07b894564740d2dcbf9b1d46bc279d30b9e3 Reviewed-by: Alan Alpert <aalpert@rim.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Reduce memory consumption of source coordinatesMatthew Vogt2012-08-161-24/+80
| | | | | | | | | | Reduce memory consumption by storing source location coordinates as 16-bit variables (in run-time structures). Also modify qmlmin to restrict line lengths so that the column bound is not normally exceeded. Change-Id: I08605626ffbdf081b6da2aea1116bdfe24998572 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-10/+10
| | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve parsing of escape characters and regexp literals.Roberto Raggi2011-12-061-13/+34
| | | | | | | | | | | | | | | | | | | | | That is, in QML/JS you can escape characters in identifiers, e.g. var c\u0061se = 25 declares a variable called `case' with value 25. In such cases qmlmin needs to preserve the escape sequence in the declaration. Also, fix possible errors when pasting keywords after regexp literals. The minifier needs to preserve the whitespace character after the regexp delimiter, e.g. /x/instanceof blah without the white space after the regexp, the `i' of `instanceof' is parsed as a regexp flag. Change-Id: I5f426ac62949e34d092d4fdb0a41243de8ff2236 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Make qmlmin use QmlDevTools library for QML parsingKent Hansen2011-10-071-3/+3
| | | | | | | | | Needed to make it link in non-developer builds. Change-Id: I45f413df5e4c01760aa245463c809c5b502a96c2 Reviewed-on: http://codereview.qt-project.org/6130 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* make qmlmin happy with '\0' in stringCharles Yin2011-10-071-0/+1
| | | | | | | | Change-Id: Ib14e2d75ea83d71c7422eb3f9560e54095300fb9 Reviewed-on: http://codereview.qt-project.org/6089 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Build with qt-in-namespaceKent Hansen2011-09-281-1/+10
| | | | | | | | Change-Id: Ia57e4f14d94ad63194dad52892bedf316a58a79a Reviewed-on: http://codereview.qt-project.org/5693 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix automatic insertion of semicolons.Roberto Raggi2011-09-191-7/+2
| | | | | | | | | | Use Lexer::canInsertAutomaticSemicolon() when recovering from errors generated by missing T_SEMICOLON tokens. Change-Id: Ie4011d8d3e02b02a7dccd0a09ffa28b1ec9e654d Reviewed-on: http://codereview.qt-project.org/5017 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add support for minimizing Javascript files containing pragmas.Roberto Raggi2011-09-191-20/+92
| | | | | | | Change-Id: Ib61d5ea42ec810c36ba782b558461bc09be199dc Reviewed-on: http://codereview.qt-project.org/5016 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Added --verify-only option to qmlmin.Roberto Raggi2011-09-191-11/+17
| | | | | | | | | | | | | | | | | qmlmin has three different stages. In the first stage it generates the QML/JS minified code. In the second stage we verify that minified code is equivalent to the original code and in the final stage we produce the output. With --verify-only you can tell qmlmin to quit after the verification step. Note that this option is pretty much equivalent to the unix command qmlmin file.qml -o /dev/null. Change-Id: I91373bc1c1db8c35af2e301ad13d7b34fc384529 Reviewed-on: http://codereview.qt-project.org/4670 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Introduced qmlmin.Roberto Raggi2011-09-191-0/+518
qmlmin is a simple minifier for QML and Javascript files. It removes comments and layout characters. Change-Id: I387a683cd9b73e8fd225e10a75b3fcec50949938 Reviewed-on: http://codereview.qt-project.org/4442 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>