| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While parsing a document Bind::asStringLiteral() Token::spell() was
called for a raw string literal token with a Token::literal nullptr.
This is due scanRawStringLiteral() not properly aborting for
invalid/incomplete code and that the code paths handling
multi-line-raw-strings were not limited to the highlighting case.
Address both cases.
Task-number: QTCREATORBUG-18941
Change-Id: I489d288ccbd7b59be396dada846613ff555436cf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
|
|
|
|
|
|
|
|
| |
With the built-in model, which affects basic highlighting.
Task-number: QTCREATORBUG-17720
Change-Id: I7369d7288d9c2c8e5ef36fc27549121014527e58
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
|
|
|
|
|
|
|
|
| |
The current code always ends up setting the token to T_GREATER_GREATER.
Change-Id: If75ff1f5bccffd5918ec2bf491724cd0981220ae
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to section 2.5 from the standard:
""" If the input stream has been parsed into preprocessing tokens up to
a given character: ... Otherwise, if the next three characters are <::
and the subsequent character is neither : nor >, the < is treated as a
preprocessor token by itself and not as the first character of the
alternative token <:. """
Change-Id: Ib9cdac61e3c2243d1bc1d4471a09ae6bd839fdda
Task-number: QTCREATORBUG-13253
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I9204b827c60b283cc4e6b88c810b31eb7587c7db
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trigraphs must only be parsed before/during preprocessing. The preprocessor
will now replace trigraphs with their standard form, and re-lexing in
TranslationUnit will not try to parse any trigraph.
Also added a few missing trigraphs: ??=, ??', ??! and ??-.
Task-number: QTCREATORBUG-13253
Change-Id: I1723ed53b00090b878c22b83b7e963b647b65f72
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
MSVC2010 supports all combinations of upper- and lowercase U/I.
Task-number: QTCREATORBUG-15554
Change-Id: I0106e6b5038a62aebe5a6c1eb0467d693befb4b0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I81ec60c1d2b670b85bfeda25e6388a12c2cd0305
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
| |
Task-number: QTCREATORBUG-13094
Change-Id: I4e6b8c202677f4c1cd4df95d59130ba8379e72fe
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
|
|
|
|
|
|
|
|
| |
...that will reduce noise in a follow-up change.
Change-Id: I39253fa631019c6d3177d2f8b2c521ec85bfba4b
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
|
|
|
|
|
|
|
| |
src/libs/3rdparty/cplusplus/Lexer.cpp(88): warning #68: integer conversion resulted in a change of sign
Change-Id: I7de033f80b0e4431b7f1ffff13fa771758c95611
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Extends lexer so digit or string can be followed by underscore '_' and
alphanumeric defining literal.
2. Extends parser so it accepts operator"" _abc(...) user-defined literal
definition.
3. Adds Token::Flags.userDefinedLiteral bool flag field representing if token
carries user-defined literal.
4. Adds C++11 auto tests case with: 12_km, 0.5_Pa, 'c'_X, "abd"_L, u"xyz"_M
5. All optional suffix scanning methods now return boolean if the suffix was
found.
6. Adds C++ Lexer tests for user-defined literals with C++11 feature enabled.
This change however does not make QtCreator understand user-defined literal
semantics, e.g. properly resolve type when applying custom literal operator.
Change-Id: I30e62f025ec9fb11c39261985ea4d772b1a80949
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Separate the messy pp-number parsing from the numeric literal parsing.
The C/C++ preprocessor makes a grown man cry, but at least we have
"proper" literal parsing when we want it, including C++1y binary
literals.
Next step is digit separators (n3781).
Change-Id: Ia069eef454ed5c056f77694a5b8a595d0b76adc4
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
|
|
|
|
|
|
|
| |
See [global.names] (17.6.4.3.2 in the C++11 spec.)
Change-Id: I8434496dbe392b52d339d5f17cfaeee8dbd88995
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
|
|
|
|
| |
In most cases we need to work with the utf16 indices. Only in
cppfindreferences the byte interface is still needed since there we read
in files and work on a QByteArray to save memory.
Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
| |
...and not byte offsets anymore. This is necessary in order to calculate
the line and column numbers correctly with respect to unicode code
points.
Change-Id: I5d79857b3eaefeb8d563b4f1e3938a64debc5e08
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
The necessary data can be retrieved by the resulting Token.
Change-Id: I79afb23183c156240c690beff30bb11dfe943e61
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: I78b70eead1c64b9925272c50cc6109c5b415574d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: Ic854958642bf1eedeb7d90ae74fb72993594b8d6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also fix false positive line continuation on blank line
e.g.
"foo \
bar"
Change-Id: Ic6d345a4b578c955411d119b8438c8dc5065c072
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
| |
Task-number: QTCREATORBUG-662
Change-Id: I0997fe2afaba71998d5da549b7141df0c023ff12
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
| |
... when needed
Change-Id: I32a1649c87e1fa42da80eff5003b2f5714062064
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: I79285a9fc72f26bdfb7c1600d4e7680e02062593
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
| |
Almost most useful feature ever.
Task-number: QTCREATORBUG-2474
Change-Id: If1ad661fab58ffb4a0b9ddb8ba771f2fde3b54ec
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
| |
Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
|
|
|
| |
See 2.5/2.12. Most useful feature ever.
Change-Id: I3f92256733e15078df56205dba9746ffff8ed145
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
|
|
| |
Some qmake versions ignore "DEFINES += NDEBUG" on Windows.
Change-Id: Ibdf3b1036c2331dcef61dcd278463c02754044d2
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: Ia37ec33fb031fdea4ad1890fcea3a80b7b46e272
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now everything following '///' or '//!' is a doxygen comment.
This simplification fixes also the bug ('\n' was considered as part of
the doxygen comment and led to strange highlighting).
Task-number: QTCREATORBUG-8921
Change-Id: I6dae3b80ec11400f2f623897257782a80860a7f3
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The color scheme changed for "///\n" lines:
"///\n" - "Doxygen Comment" (was "Comment")
"/// hello\n" - "Doxygen Comment" (as before)
"////...\n" - "Comment" (as before)
Change-Id: I6bdaf471760bb05547385fd4821eded6cefed4d7
Reviewed-by: Knut Petter Svendsen <knutpett@pvv.org>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
This makes things slightly more efficient. But it will be more
significant when we introduce R"rawliterals" since we would avoid
an even further lookahead for cases like u8R"string".
Change-Id: Id4bad8b917752d23daf2f4989330434979cf602f
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
|
|
|
|
|
|
|
|
| |
Previously it was considering invalid things `such as U8"literal".
Change-Id: Icf4d051a26617ac2c6cb35d5a98f8af0ed801556
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
|
|
|
|
|
|
|
|
|
| |
Actually this behavior was already in the Lexer for regular string
literals (although erroneously not for wide ones) and was lost
in the recent commit 23c637c4f677ab2f19793f409297b0131b21dcaa.
Change-Id: I36609038ce22dc6389e9da5b078f7bf7f6c031be
Reviewed-by: hjk <qthjk@ovi.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
The change brokes the Lexer.
This reverts commit e46a5579d368162034813cc4b27d8d5c9f0716d9.
Change-Id: I3363c6eff74b53a7f2d9f417941cde07aaa92619
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
|
|
|
|
|
|
|
|
|
|
| |
The whitespaces are now highlighted with the same backgroundcolor as the characters.
Also added a test for the Lexer.
Task-number: QTCREATORBUG-5802
Change-Id: Ic1bcd8cfe30d6b8a0281b7963eaab310f972b9d2
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
|
|
|
|
|
|
|
| |
Change-Id: I919a2e98474fec42861391d11d2ba1225eb2adf9
Reviewed-on: http://codereview.qt.nokia.com/4083
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
|
|
|
|
|
|
|
|
| |
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
|
|
Approved-by: legal
|