diff options
| author | amitkummer <49096391+amitkummer@users.noreply.github.com> | 2021-12-30 16:40:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-30 15:40:59 +0100 |
| commit | ed2bdcdadaff58c183d5127e0af77e72b7b7f501 (patch) | |
| tree | d627ebf8cb40d2d101428527d3349de9f40ea5ce /tests/examplefiles | |
| parent | dcea4d84a9bd252c6f9f1db4c0116bca30e39ae6 (diff) | |
| download | pygments-git-ed2bdcdadaff58c183d5127e0af77e72b7b7f501.tar.gz | |
CFamily: improve function detection (#2008)
Detect function with return types of more than a single word length
(like `unsigned int` or `long long`).
Diffstat (limited to 'tests/examplefiles')
| -rw-r--r-- | tests/examplefiles/cpp/functions.cpp | 3 | ||||
| -rw-r--r-- | tests/examplefiles/cpp/functions.cpp.output | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/examplefiles/cpp/functions.cpp b/tests/examplefiles/cpp/functions.cpp index 662e0d2c..ef359fe0 100644 --- a/tests/examplefiles/cpp/functions.cpp +++ b/tests/examplefiles/cpp/functions.cpp @@ -62,6 +62,9 @@ explicit const string contains(const char* str) {} explicit const string contains(const char * str); explicit const string contains(const char * str) {} +unsigned int contains() {} +unsigned int contains(); + // Names with namespaces string Type::contains(char c) const noexcept; diff --git a/tests/examplefiles/cpp/functions.cpp.output b/tests/examplefiles/cpp/functions.cpp.output index 64ab8fb7..619b3fdd 100644 --- a/tests/examplefiles/cpp/functions.cpp.output +++ b/tests/examplefiles/cpp/functions.cpp.output @@ -1091,6 +1091,30 @@ '\n' Text.Whitespace +'unsigned' Keyword.Type +' ' Text.Whitespace +'int' Keyword.Type +' ' Text.Whitespace +'contains' Name.Function +'(' Punctuation +')' Punctuation +' ' Text.Whitespace +'{' Punctuation +'}' Punctuation +'\n' Text.Whitespace + +'unsigned' Keyword.Type +' ' Text.Whitespace +'int' Keyword.Type +' ' Text.Whitespace +'contains' Name.Function +'(' Punctuation +')' Punctuation +';' Punctuation +'\n' Text.Whitespace + +'\n' Text.Whitespace + '// Names with namespaces\n' Comment.Single '\n' Text.Whitespace |
