aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
diff options
context:
space:
mode:
authorMarek Kurdej <marek.kurdej+llvm.org@gmail.com>2022-02-02 10:13:12 +0100
committerMarek Kurdej <marek.kurdej+llvm.org@gmail.com>2022-02-02 10:25:24 +0100
commitbc40b76b5b95837e27217de6a446eeeace695f34 (patch)
tree9342f16ad57292a645664bd7a9a16469d969fafa /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
parent8a12cae862af3208609127aaf288ab5298d33d38 (diff)
downloadllvm-bc40b76b5b95837e27217de6a446eeeace695f34.zip
llvm-bc40b76b5b95837e27217de6a446eeeace695f34.tar.gz
llvm-bc40b76b5b95837e27217de6a446eeeace695f34.tar.bz2
[clang-format] Correctly parse C99 digraphs: "<:", ":>", "<%", "%>", "%:", "%:%:".
Fixes https://github.com/llvm/llvm-project/issues/31592. This commits enables lexing of digraphs in C++11 and onwards. Enabling them in C++03 is error-prone, as it would unconditionally treat sequences like "<:" as digraphs, even if they are followed by a single colon, e.g. "<::" would be treated as "[:" instead of "<" followed by "::". Lexing in C++11 doesn't have this problem as it looks ahead the following token. The relevant excerpt from Lexer::LexTokenInternal: ``` // C++0x [lex.pptoken]p3: // 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 <:. ``` Also, note that both clang and gcc turn on digraphs by default (-fdigraphs), so clang-format should match this behaviour. Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D118706
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
0 files changed, 0 insertions, 0 deletions