summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/parser
Commit message (Collapse)AuthorAgeFilesLines
* qmldir parser: Handle internal types with versionsUlf Hermann2023-02-081-5/+19
| | | | | | | | | | | There is no reason why internal types cannot have versions. Fixes: QTCREATORBUG-28755 Change-Id: I419f2e052634b603dfc5b2bfff155167cf6f9304 Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-0623-26/+26
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Update the qml code model parserSami Shalayel2023-01-0517-3429/+3922
| | | | | | | | | | Updates the qml code model from qtdeclarative dev (commit: 164d8f66d82deea74464c68a2cdd19e5998835da). Fixes: QTCREATORBUG-28238 Change-Id: I383c98012f1efd56110d43c258fa1b398a6f8255 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* changeLicense.py: support new license styleSami Shalayel2022-12-211-9/+37
| | | | | | | | | | Add support for the new licenses (that are commented out linewise via //) to changeLicense.py that until know just knew about the old-style licenses commented as /*block*/. Change-Id: If29c4a49e210cf7516ae93fb1b7ef7e9f5a51f34 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmljs: Remove foreach usageArtem Sokolovskii2022-12-211-1/+1
| | | | | | | | Task-number: QTCREATORBUG-27464 Change-Id: Ifdb8cf514dfe328e0a64bde1beff3e63a4b7fbc3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Remove outdated version checksRobert Löhning2022-09-121-4/+0
| | | | | | Change-Id: I972a7fe0842a0310ba5df1233a4f417627dad87c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Use SPDX license identifiersLucie Gérard2022-08-2622-541/+43
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Drop Qt5: Qml lib / QmlDesigner: Get rid of QOverloadJarek Kobus2022-07-201-1/+1
| | | | | | | | Add a context object into some lambdas. Change-Id: I16ee7a0c061483e4d90c9e015852c41a4f3cde90 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QmlJS: Improve parser performancehjk2022-06-282-4/+4
| | | | | | | | | | | | | Detaching the rawString_stack alone shows up at 0.85% when loading Creator inside Creator. One write access is actually used from qmljs.g:699, so making the whole function const would need more work. Take a short cut and replace the unneeded reference counted container with a non-reference counted one. Change-Id: I081bf5741899a01e4126b7ffe4f36e4844f0b19e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* CMake: Qt Creator Static build supportCristian Adam2022-04-291-1/+1
| | | | | | | | | | | | | | | | | | | This adds the build system feature that allows Qt Creator's libraries and plugins to be compiled statically. Fixes some symbol clashes when all plugins are linked into the same executable. Support for actually loading static plugins will be added in a separate commit. The feature is controlled by QTC_STATIC_BUILD which by default is OFF. Change-Id: I1fab7953c43e42dc75619e35660029ee067106df Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QmlJS: Fix compiulation with namespaceshjk2022-02-101-2/+4
| | | | | | | Amends 125d7c0cced77. Change-Id: I75f2c562aca2e3a00bb0284f39c3951664e2c956 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove qmake build filesEike Ziller2022-01-201-32/+0
| | | | | | | | | | Removes qmake as a build system for building Qt Creator itself. Keep them for some tests that are not completely moved to CMake yet. Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlJS: Add a missing includeOrgad Shaneh2022-01-041-0/+1
| | | | | | | Amends 125d7c0cced77ac39623cd05d0c22f690d427542. Change-Id: Ibfd6bb7da52547f743534105bf759387b674c2c1 Reviewed-by: hjk <hjk@qt.io>
* Updating qmljs parser to latest qtdeclarative parserFawzi Mohamed2021-12-1617-6352/+6058
| | | | | | | | | | | improves support for string templates, required properties, and other smaller improvements Task-number: QTCREATORBUG-21869 Change-Id: Ia2359e1f75d4bd7b9ea4f27a920acd2251e36108 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlJS: Fix build with Qt5.14Christian Stenger2021-07-202-3/+12
| | | | | | | | Amends af88a7876b5. Change-Id: If3f45922dd822797d477ac8116b4fcbed86c746a Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmljs: fix order in BoundNameFawzi Mohamed2021-07-202-3/+3
| | | | | | | constructor and field order should be consistent Change-Id: If698fd66cf67ab54c4be1638f19d758a54e33d5f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* qmljs: update gen-parser.sh and related patchesFawzi Mohamed2021-07-203-78/+509
| | | | | | | | | | ensure that the script works with the current source * update manual patches * use reverse patches to simplify updating procedure * describe updating procedure Change-Id: I23f8ee5bd73506df03b8b6b75e535170dff5f2b5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmljs: update Qml parser to parser of Qt 6.2Fawzi Mohamed2021-07-2024-3382/+3734
| | | | | | | | | this is needed (among other things) for * null coalescing * shebang support Change-Id: I1b37fd86593f143de8b39c0daf433831a8785568 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Do not pass QStringView by const referenceKai Köhne2021-06-172-39/+39
| | | | | | | | | | That's what the documentation says: https://doc.qt.io/qt-6/qstringview.html#details Change-Id: I0b41fc4abad1601c0ed416a505534cf7ae7633e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* qmljs: fix arrow function reformattingFawzi Mohamed2021-02-034-116/+128
| | | | | | | | | | | | | | | | | This is mainly just making sure that token that are "empty" are really empty (to avoid writing them out in the reformatter), but still contain the correct location (for error messages using for example firstSourceLocation()). Introduce a SourceLocation::zeroLength() method to make this change simpler to do. QtCreator does not run qlalr automatically, so it is "polluted" by the updated generated files. Fixes: QTCREATORBUG-25198 Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlJs: Fix reformatter for arrow functionsLeander Schulten2020-12-172-11/+14
| | | | | | Fixes: QTCREATORBUG-23019 Change-Id: I6c6bee7092cb12f225ad744df2b3834dfd4bbc8f Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* qmljs: Fix parsing and and loading of qmldir importsFawzi Mohamed2020-11-262-36/+126
| | | | | | | | | | | | Add most changes to the qmldir parser of Qt6. This is not a direct application of the changes because they rely on changes to QtBase that are Q6 only. Ignore load errors of optional dependencies. Fixes: QTCREATORBUG-24772 Change-Id: I0b85818b602c8c7c1712e52318b4ca3f15364cc5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Avoid more uses of non-explicit QChar(int) constructorhjk2020-11-101-1/+1
| | | | | | | | Will be gone in Qt6. Task-number: QTCREATORBUG-24098 Change-Id: Id76b15bb11879b2e8ff0f71af45acbfb1720f763 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/4.13' into masterEike Ziller2020-10-021-8/+11
|\ | | | | | | Change-Id: I3f2a6c553819e992da7e9f538dc44b95b482359e
| * QmlJS: fix reformatting of required propertiesFawzi Mohamed2020-10-011-8/+11
| | | | | | | | | | | | Fixes: QTCREATORBUG-24376 Change-Id: I9ebe66f881575ce8e58cee46d34c3ff8da55ef9c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QmlJS: Do not change strings referenced by QStringViewThomas Hartmann2020-09-242-10/+11
| | | | | | | | | | | | | | | | | | | | | | QStringRef is stable under reallocations of it's string()), while QStringView is not. This adds the missing changes from qtdeclarative 1b10ce6a08e. Task-number: QDS-2825 Change-Id: I120a34153424ea514abaa783f1a617ef2f8b4cf4 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Make QmlJS(Tools) build with Qt5 & Qt6Eike Ziller2020-09-1712-236/+332
| | | | | | | | | | | | | | Port from QStringRef to QStringView Change-Id: I472d16f20e40ca52b8e5d481850a6bd8a1a38f3b Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/4.13' into masterEike Ziller2020-08-105-2585/+2665
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/cmakeprojectmanager/cmakebuildstep.cpp src/plugins/cmakeprojectmanager/cmakebuildstep.h tests/auto/debugger/tst_namedemangler.cpp tests/auto/qml/codemodel/check/tst_check.cpp Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
| * qmljs: qtdeclarative change 9ab1a6759018b78b0f160c5286f8b0235a34ec50Fawzi Mohamed2020-08-035-2585/+2665
| | | | | | | | | | | | | | | | | | | | Support required list properties The corresponding rules were missing so far. Fixes: QTBUG-85716 Change-Id: Iaf0cbfbb8736929a213bd6bf329bb2ebdde652c4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Adapt qmljslexer to Qt base change caa40f57d4dhjk2020-08-101-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | qstrtod is no longer exported. This effectively reverts commit 149cc3af6 as it causes an explicit dependency on private headers, leading to more problems downstream than the implicit dependency using the declaration. Change-Id: I93a9cfc6e440b20d6bed51504bb8004fd67f341c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Fix build with Qt 6: qstrtod is an inline functionThiago Macieira2020-08-081-3/+1
|/ | | | | | | Change-Id: Ib620871532484bcaa43cfffd1628d6bf0f93fd78 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: hjk <hjk@qt.io>
* QmlJS: Fix line number for string literals (Part 2)Christian Stenger2020-06-101-2/+4
| | | | | | | | | | Amends 626807c94e3c1e3d. Scanning the strings appears differently if using multi-line strings and using the line terminator at the beginning of a string or having already some characters present. Fixes: QTCREATORBUG-23777 Change-Id: I840a11e3b0e06adda443849f926189bda9dc2e4b Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* QmlJS: Fix line number for string literalsChristian Stenger2020-04-291-1/+3
| | | | | | | | | | When a string value's first line ends with an EOL the line number for the next line got wrong which in turn confused the syntax highlighter. Fixes: QTCREATORBUG-23777 Change-Id: I37eed839a2e63cf470b9bc2ac0596ab8bc8d373c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlJS: Fix lexer handling of escape sequences (again)Christian Stenger2020-04-291-11/+2
| | | | | | | | | | | The lexer handled escape sequences already, but not fully correct. This effectively reverts 63db0f271fd2f and fixes the wrong offset. Task-number: QTCREATORBUG-23830 Change-Id: I2cc1e9df5c0218cf9ee80998adce69bbc2eb4dab Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlJS: Fix lexer handling of escape sequencesChristian Stenger2020-04-241-1/+11
| | | | | | | | | | | Escape sequences inside strings need to get handled explicitly to avoid wrong length and offsets of tokens to avoid follow-up problems while highlighting or symbol interaction. Fixes: QTCREATORBUG-23830 Change-Id: I4ab0b166bbab22ef3b7b54071e128416a14e97e1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlJS: Fix up compile fixChristian Stenger2020-03-042-3/+4
| | | | | | | Amends 33b091bd40187449a3e925659ae0738786e09de3. Change-Id: I26d98bae8a074f7c3515b46994afd5548e2ca82f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QmlJS: Fix compileChristian Stenger2020-03-042-3/+7
| | | | | | | | ..in general, with tests, and when using a namespaced Qt. Amends b09a48599e7. Change-Id: I99e275e10df5eed741d021911a360457f0d0d2e7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlJS: Fix compiler warning and add a missing includeOrgad Shaneh2020-03-031-0/+1
| | | | | | | | | | qmljsdiagnosticmessage_p.h: In static member function ‘static QmlJS::Severity::Enum QmlJS::DiagnosticMessage::qtMsgTypeToKind(QtMsgType)’: qmljsdiagnosticmessage_p.h:72:5: warning: control reaches end of non-void function [-Wreturn-type] 72 | } | ^ Change-Id: I2183199bf257453e0af2998b739fae8c90f5c098 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* Update qmljs parser to Qt 5.15 parserFawzi Mohamed2020-03-0326-4167/+4913
| | | | | | | | | | | | | * parser side support for annotations, inline components, new UiVersion and all the things included in QT 5.15 parser * SourceLocation moved from QmlJS:AST to QmlJS * Visitors now need to handle throwRecursionDepthError * BaseVisitor for visitors that want to override all visit Task-number: QTCREATORBUG-23591 Change-Id: I682a30d0b08b6c929739fd0e339ef6fbde3eb630 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QmlJS: Fix regression caused by parser updateThomas Hartmann2019-10-211-1/+1
| | | | | | | | | We have to keep the semicolonToken into account. Change-Id: Ie599d141d21f09f1d0036c0382f6a3098fde6ca5 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix parsing of QML version tokens in the presence of "as Foo"Ulf Hermann2019-10-102-4/+14
| | | | | | | | | The previous code would omit the minor version, leading to a test failure. Change-Id: I3dccee5252a54806f8e1e5bf5c49eff149d9b936 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlJS: Update QML parser using the one from qtdeclarative 5.15Ulf Hermann2019-10-0713-3407/+4238
| | | | | | | | | | | | | | | | We need to do this because the new "required" keyword should be recognized by Qt Creator. This is not a verbatim copy of the QML parser from qtdeclarative. A few data structures have changed that would require large scale changes in otherwise unrelated parts of the code. For example, all Visitors need to handle recursion depth errors now and the DiagnosticMessage only has line and column now, no longer begin and legth. Change-Id: Iea5b04e27b07e0cba55d64b844315af9828acbf7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Avoid warning on empty expressionshjk2019-07-231-9/+9
| | | | | | | | For some reason, Q_UNUSED includes already a semicolon, adding one on the user side creates an additional empty statement. Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* qmljs: sync parser with current 5.12 stateTim Jenssen2019-06-202-22/+48
| | | | | | Task-number: QTCREATORBUG-22474 Change-Id: I86d7ee7cc28e95f814f2ba36551a36c8a59e1a79 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmljs: update parserMarco Benelli2018-11-2219-5408/+10248
| | | | | | | | | Update the qtcreator qmljs parser to the one of Qt 5.12. It supports EcmaScript 7. Task-number: QTCREATORBUG-20341 Change-Id: I0d1cff71402ba17e22cde6b46c65614e162280de Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* qmljs: handle js directives .pragma and .importMarco Benelli2018-04-122-2/+5
| | | | | | | | | | | | | | | The directives .pragma and .import are not included in the AST. Their source code locations are not stored in any other place. As a result, when reformatting the source, they simply disappear. This patch keep track of their source code locations, so they are not removed when reformatting the source code. This patch contains also some modification in the lexer that should probably be ported to the qtdeclarative version. Task-number: QTCREATORBUG-13038 Change-Id: I5d568abf02d37a584d4d246939736aaec5af5053 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlJS: Sync parser with Qt 5.10Orgad Shaneh2018-04-114-38/+42
| | | | | Change-Id: I87c64edc1235bab10b9f32abeab4386b5cc7390b Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Utils: Purge qtcfallthrough.hOrgad Shaneh2018-04-091-2/+0
| | | | | | | No longer needed. Change-Id: I9b0bee014df89d4c567f1d2431b5ff9404f5f925 Reviewed-by: hjk <hjk@qt.io>
* QmlJS: Update gen-parser.shOrgad Shaneh2018-04-092-1/+16
| | | | | | | | Try to minimize differences on sync Change-Id: I9af325911b1a6a7635099cb3a5c778305e5e6223 Reviewed-by: Marco Benelli <marco.benelli@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-01-251-1/+3
|\ | | | | | | Change-Id: I724da8f761275865e735e7dce10c3b2b2d99fe94