summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* moc: Remove remnants of USE_LEXEM_STOREFabian Kosmale2023-08-101-4/+0
| | | | | | | | | | Defining USE_LEXEM_STORE breaks compilation, and the commit that introduce it (in the pre-public history) does not shed any light on its usage. Change-Id: Ic616bf9f2584151dab3f654d64025fcdc0ade25c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Moc: simplify showing a warningAhmad Samir2023-06-221-2/+7
| | | | | | | | | Instead of changing the "index" member then restoring it, add a symbolAt() method to get the Symbol in question, and pass it to new warning() overload. Change-Id: Ie84a6cf4d837f4ed694f617100e9556c2fc2eea3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Moc: streamline how diagnostic messages are printedAhmad Samir2023-06-051-14/+44
| | | | | | | | | | | | | | | | | | | If we don't have a valid Symbol to get a line number from, or if the symbol.lineNum is -1, print a shorter message containing only the file path. Printing: '/path/to/file:-1:1' isn't useful (and looks wrong). Change error/defaultErrorMsg/warning/note() to delegate to one central method, so that they all behave the same; e.g. previously warning() and note(), guarded against printing "-1" for the line number, whereas error() didn't. This also makes it possible to use error() for reporting other issues (e.g. the size of generator.strings list exceeding INT_MAX, which will happen in a later commit). Pick-to: 6.6 Change-Id: Iddc96e08315fae415be6a84928f845d7bceb4c5f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* MOC: pass the erroneous Symbol as an arg to Parser::error() overloadAhmad Samir2023-05-151-5/+12
| | | | | | | | | | | | | | | | | | | | We already know the Symbol while parsing, passing a reference to it to error() makes it simpler to construct the error message. This fixes an issue where reporting an error about "NONSENSE" in e.g.: Q_PROPERTY(Foo* foo NONSENSE foo) would be off-by-one and the error message would say: path/to/file.h:11:1: error: Parse error at "foo" instead of 'at "NONSENSE"', which is where the parser actually found an unexpected attribute. Fixes: QTBUG-36367 Pick-to: 6.5 Change-Id: Ief70e544af41f7575fbeea9b936fa8197c3ef43d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* moc: output errors and warnings in a way that matches compilersVolker Hilsheimer2020-11-091-10/+10
| | | | | | | | | | | | | | | | | | gcc, clang, and MSVC all use lowercase "warning:", "error:" and "note:". Follow that standard. Also, include a column number; just print 1, as the Symbol doesn't give us a column number, and searching backwards for a newline seems overkill. This fixes IDE integrations that parse compiler output using regular expressions. The test checks for moc output, but most tests were so far only running on Linux systems. Expand this to Unix for most tests, which then includes macOS. Change-Id: I0a6151cc0dc50e52ca72ff8048a45213aebdb3a8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-1/+1
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated license headersJani Heikkinen2016-01-211-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: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-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. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* moc: use fprintf instead of qWarningOlivier Goffart2013-05-081-2/+2
| | | | | | | | | qWarning now depends on QT_MESSAGE_PATTERN, depending on that variable. It will show things like the moc process id or the Parser::error function name. We don't want that. Change-Id: I5b35401200f0f7de2442aa77d700a82402081489 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.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: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+87
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12