diff options
| author | Georg Brandl <georg@python.org> | 2021-01-18 21:24:00 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2021-01-18 22:08:36 +0100 |
| commit | 2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch) | |
| tree | 809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/cpp/example3.txt | |
| parent | f0445be718da83541ea3401aad882f3937147263 (diff) | |
| download | pygments-git-examplefiles.tar.gz | |
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/cpp/example3.txt')
| -rw-r--r-- | tests/lexers/cpp/example3.txt | 171 |
1 files changed, 171 insertions, 0 deletions
diff --git a/tests/lexers/cpp/example3.txt b/tests/lexers/cpp/example3.txt new file mode 100644 index 00000000..c60f8e7e --- /dev/null +++ b/tests/lexers/cpp/example3.txt @@ -0,0 +1,171 @@ +---input--- +/* + * A Test file for the different string literals. + */ + +#include <iostream> + +int main() { + char *_str = "a normal string"; + wchar_t *L_str = L"a wide string"; + char *u8_str = u8"utf-8 string"; + char16_t *u_str = u"utf-16 string"; + char32_t *U_str = U"utf-32 string"; + char *R_str = R""""(raw string with +""" +as a delimiter)""""; + + std::cout << R_str << std::endl; + + return 0; +} + +---tokens--- +'/*\n * A Test file for the different string literals.\n */' Comment.Multiline +'\n' Text + +'\n' Text + +'#' Comment.Preproc +'include' Comment.Preproc +' ' Text +'<iostream>' Comment.PreprocFile +'\n' Comment.Preproc + +'\n' Text + +'int' Keyword.Type +' ' Text +'main' Name.Function +'(' Punctuation +')' Punctuation +' ' Text +'{' Punctuation +'\n' Text + +' ' Text +'char' Keyword.Type +' ' Text +'*' Operator +'_str' Name +' ' Text +'=' Operator +' ' Text +'"' Literal.String +'a normal string' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'wchar_t' Keyword.Type +' ' Text +'*' Operator +'L_str' Name +' ' Text +'=' Operator +' ' Text +'L' Literal.String.Affix +'"' Literal.String +'a wide string' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'char' Keyword.Type +' ' Text +'*' Operator +'u8_str' Name +' ' Text +'=' Operator +' ' Text +'u8' Literal.String.Affix +'"' Literal.String +'utf-8 string' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'char16_t' Keyword.Type +' ' Text +'*' Operator +'u_str' Name +' ' Text +'=' Operator +' ' Text +'u' Literal.String.Affix +'"' Literal.String +'utf-16 string' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'char32_t' Keyword.Type +' ' Text +'*' Operator +'U_str' Name +' ' Text +'=' Operator +' ' Text +'U' Literal.String.Affix +'"' Literal.String +'utf-32 string' Literal.String +'"' Literal.String +';' Punctuation +'\n' Text + +' ' Text +'char' Keyword.Type +' ' Text +'*' Operator +'R_str' Name +' ' Text +'=' Operator +' ' Text +'R' Literal.String.Affix +'"' Literal.String +'"""' Literal.String.Delimiter +'(' Literal.String.Delimiter +'raw string with\n"""\nas a delimiter' Literal.String +')"""' Literal.String.Delimiter +'"' Literal.String +';' Punctuation +'\n' Text + +'\n' Text + +' ' Text +'std' Name +':' Operator +':' Operator +'cout' Name +' ' Text +'<' Operator +'<' Operator +' ' Text +'R_str' Name +' ' Text +'<' Operator +'<' Operator +' ' Text +'std' Name +':' Operator +':' Operator +'endl' Name +';' Punctuation +'\n' Text + +'\n' Text + +' ' Text +'return' Keyword +' ' Text +'0' Literal.Number.Integer +';' Punctuation +'\n' Text + +'}' Punctuation +'\n' Text |
