aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Token.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add syntax highlight for primitive data typesAnton Kalmykov2014-06-241-8/+11
| | | | | | | | Syntax highlight rules for keywords are changed to highlight control keywords and primitive data types separately. Change-Id: Ifb25be7a97b92589030aa190641320c233dc7f2d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Support for UTF-8 in the lexerNikolai Kosjar2014-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will save us toLatin1() conversations in CppTools (which already holds UTF-8 encoded QByteArrays) and thus loss of information (see QTCREATORBUG-7356). It also gives us support for non-latin1 identifiers. API-wise the following functions are added to Token. In follow-up patches these will become handy in combination with QStrings. utf16chars() - aequivalent of bytes() utf16charsBegin() - aequivalent of bytesBegin() utf16charsEnd() - aequivalent of bytesEnd() Next steps: * Adapt functions from TranslationUnit. They should work with utf16 chars in order to calculate lines and columns correctly also for UTF-8 multi-byte code points. * Adapt the higher level clients: * Cpp{Tools,Editor} should expect UTF-8 encoded Literals. * Cpp{Tools,Editor}: When dealing with identifiers on the QString/QTextDocument layer, code points represendet by two QChars need to be respected, too. * Ensure Macro::offsets() and Document::MacroUse::{begin,end}() report offsets usable in CppEditor/CppTools. Addresses QTCREATORBUG-7356. Change-Id: I0791b5236be8215d24fb8e38a1f7cb0d279454c0 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Clarify units of a TokenNikolai Kosjar2014-05-151-1/+1
| | | | | | | | | | | | | This will avoid confusion when later more length and indices methods are added. In Token: length() --> bytes() begin() --> bytesBegin() end() --> bytesEnd() Change-Id: I244c69b022e239ee762b4114559e707f93ff344f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Support __thread and thread_localOrgad Shaneh2013-11-261-2/+2
| | | | | | | Task-number: QTCREATORBUG-7679 Change-Id: I794f52b2bcfb6c78ceef86ec53b6ed32b3d53d9f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Use the canonical version of defining string literalshjk2013-09-271-1/+1
| | | | | Change-Id: If36658de6f68f552f93830ba4f1cfa9994a2e44c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* C++11: Add the alignof and alignas tokens.Christian Kamm2012-09-171-1/+1
| | | | | Change-Id: I7f60057953787b3300aafa4d3f230f10b1e9a50f Reviewed-by: hjk <qthjk@ovi.com>
* C++: Introduce C++11 raw string literalsLeandro Melo2012-08-231-0/+7
| | | | | | | | | | | | Although they are now supported by the lexer and parser, it is worth to remind that we still need to address an issue concerning the highlight of multiline literals (which with the advent of the new raw strings will become more common). Task-number: QTCREATORBUG-6722 Change-Id: I137337a9ac0152a1f8b9faded0b960c6fe3dd38a Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Parse emit/Q_EMIT properlyLeandro Melo2012-06-281-2/+2
| | | | | | | | | | | | | | | | | The parser now understands emit/Q_EMIT as an expression statement. Also, the recent fixes in the preprocessor introduced a side-effect in the hanlding of code such as: emit signal(); Member signal started being treated as a local use (parsed as a declaration) and possibily being highlighted as unused variable. Previously that worked by accident since there was an inconsistency in the preprocessor on which only object-like macros were being expanded even when the "no expand" flag was set. Then, the code mentioned above was being parsed as an expression, what kind of worked. Change-Id: I47a68ed4c1c1702872620b8ed7c7264fb0997034 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Introduce unicode char/strings supportLeandro Melo2012-06-061-5/+15
| | | | | | | | | | | | | | Those are the types char16_t and char32_t along with the new char/string literals u'', U'', u"", u8"", and U"". This is particularly important for the use of QStringLiteral since in some platforms it relies on expansion such as above. Note: The string literals quickfixes still need some tunning. Task-number: QTCREATORBUG-7449 Change-Id: Iebcfea15677dc8e0ebb6143def89a5477e1be7d4 Reviewed-by: hjk <qthjk@ovi.com>
* cplusplus: do not use out-of-line constructor and destructor for Tokenhjk2012-04-181-9/+0
| | | | | Change-Id: I10320b01a567789585a6af111de4de3f95883bd1 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: first set of changes for decltype.Erik Verbruggen2012-02-101-1/+2
| | | | | Change-Id: I49d6ff7eb1805cd07bdfcb27bb37d4c6cadc9115 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: add support for static_assert.Erik Verbruggen2012-02-021-1/+1
| | | | | Change-Id: I82d8d60acaa9265fd25e0a3734855b19bdef9c06 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: handle noexcept specifications.Erik Verbruggen2012-02-021-1/+2
| | | | | Change-Id: I7da3affea2758b2e01124105e2521e1f2c5f6678 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Add names for tokens constexpr and nullptrLeandro Melo2011-11-181-2/+2
| | | | | | | | Actually, those should have gone in the previous corresponding commits which introduced support for the keywords. Change-Id: Ie95944899c426a2c2b03e60d1ad557e00bc3a82a Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: fixed potential crash for out of bounds access of token_names.Erik Verbruggen2011-09-051-1/+2
| | | | | | | | | | Cause: Q_PRIVATE_PROPERTY didn't have an entry in token_names, so if Token::spell or Token::name was called on a T_Q_GADGET, an out-of-bounds access would occur. Change-Id: I1ec7b91a5d3def5508e21ad4f1863a52cb4ed540 Reviewed-on: http://codereview.qt.nokia.com/4207 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* remove nokia copyrights from roberto's codeOswald Buddenhagen2011-05-161-31/+0
| | | | | | | | they are lying. nokia has no copyright on this code. and the double license in a single file looks weird. that's why we moved it to 3rdparty/, so it is clear it is not nokia's. Approved-by: legal
* move src/shared/cplusplus/ -> src/libs/3rdparty/cplusplus/Oswald Buddenhagen2011-05-161-0/+144
Approved-by: legal