<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pygments-git.git/tests/examplefiles/cpp, branch master</title>
<subtitle>github.com: pygments/pygments.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/'/>
<entry>
<title>CFamilyLexer: Fix matching of function parameters (#2210)</title>
<updated>2022-08-18T13:15:40+00:00</updated>
<author>
<name>amitkummer</name>
<email>49096391+amitkummer@users.noreply.github.com</email>
</author>
<published>2022-08-18T13:15:40+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=adb90dc65f2f211675af5be27d2a7efdf96c6f44'/>
<id>adb90dc65f2f211675af5be27d2a7efdf96c6f44</id>
<content type='text'>
This fixes an issue where in code like this:

```
int foo(float bar) // hello() {}
```

The lexer would match `(float bar) // hello()`
as the parameters of the function `foo`, instead
of just `(float bar)`.

In addition, a similar test case to what was originally
reported in #2208 is added.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes an issue where in code like this:

```
int foo(float bar) // hello() {}
```

The lexer would match `(float bar) // hello()`
as the parameters of the function `foo`, instead
of just `(float bar)`.

In addition, a similar test case to what was originally
reported in #2208 is added.</pre>
</div>
</content>
</entry>
<entry>
<title>CFamilyLexer: refuse quotes between parentheses for function definitions and declarations (#2208)</title>
<updated>2022-08-15T09:45:13+00:00</updated>
<author>
<name>Jean Abou-Samra</name>
<email>jean@abou-samra.fr</email>
</author>
<published>2022-08-15T09:45:13+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=d6968f804ab817c29f9f0ca408279adf82b006f9'/>
<id>d6968f804ab817c29f9f0ca408279adf82b006f9</id>
<content type='text'>
Something like

id id2("){ ... }");

is no longer wrongly recognized as a "function"

id id2(") {
  ...
}
");

As the difference in the tests shows, this has the unfortunate side
effect that we no longer highlight something like

int f(param="default");

as a function declaration, but it is hard to imagine another way to
fix this (cf. “most vexing parse” problem).

Fixes #2207</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Something like

id id2("){ ... }");

is no longer wrongly recognized as a "function"

id id2(") {
  ...
}
");

As the difference in the tests shows, this has the unfortunate side
effect that we no longer highlight something like

int f(param="default");

as a function declaration, but it is hard to imagine another way to
fix this (cf. “most vexing parse” problem).

Fixes #2207</pre>
</div>
</content>
</entry>
<entry>
<title>CFamily: improve function detection (#2008)</title>
<updated>2021-12-30T14:40:59+00:00</updated>
<author>
<name>amitkummer</name>
<email>49096391+amitkummer@users.noreply.github.com</email>
</author>
<published>2021-12-30T14:40:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=ed2bdcdadaff58c183d5127e0af77e72b7b7f501'/>
<id>ed2bdcdadaff58c183d5127e0af77e72b7b7f501</id>
<content type='text'>
Detect function with return types of more than a single word length
(like `unsigned int` or `long long`).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Detect function with return types of more than a single word length
(like `unsigned int` or `long long`).</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #1237 cpp whitespace token usage expanded (#1904)</title>
<updated>2021-10-02T10:23:26+00:00</updated>
<author>
<name>Sebastian Engel</name>
<email>github@sebastianengel.eu</email>
</author>
<published>2021-10-02T10:23:26+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=320853d7e46f96bd60acbfb23fc74b58104098c1'/>
<id>320853d7e46f96bd60acbfb23fc74b58104098c1</id>
<content type='text'>
* Fix #1237 cpp whitespace token usage expanded

* Adapt tests change to 3eff56f5</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix #1237 cpp whitespace token usage expanded

* Adapt tests change to 3eff56f5</pre>
</div>
</content>
</entry>
<entry>
<title>Use the correct whitespace token for the C family.</title>
<updated>2021-06-20T09:42:04+00:00</updated>
<author>
<name>Matthäus G. Chajdas</name>
<email>dev@anteru.net</email>
</author>
<published>2021-06-20T09:42:04+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=a537d5e9663e888706df75c40826be3aed177959'/>
<id>a537d5e9663e888706df75c40826be3aed177959</id>
<content type='text'>
The CFamilyLexer was matching whitespace as Text instead of Whitespace.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The CFamilyLexer was matching whitespace as Text instead of Whitespace.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix CFamilyLexer preprocessor tokenization errors (#1830)</title>
<updated>2021-06-20T09:38:00+00:00</updated>
<author>
<name>Henrik Lievonen</name>
<email>henrik.lievonen@hotmail.com</email>
</author>
<published>2021-06-20T09:38:00+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=fea1fbc0576bb9d6d1dc84ac8cc3825e0a4e5232'/>
<id>fea1fbc0576bb9d6d1dc84ac8cc3825e0a4e5232</id>
<content type='text'>
CFamilyLexer failed to tokenize preprocessor macros when they were
preceded by line break surrounded by spaces. This was the case because
prerpocessor regex rule expected to start at the beginning of the line,
but the space regex rule matched also the whitespace after the line
break. Now the space rule has been refined not to match the line break.
Because of this, the preprocessor regex rule correctly matches
prerpocessor tokens even when they are preceded by white spaces, at the
cost of adding some more tokens in the token stream in some cases. This
change preserves the behavior of invalid preprocessor usage failing to
tokenize.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CFamilyLexer failed to tokenize preprocessor macros when they were
preceded by line break surrounded by spaces. This was the case because
prerpocessor regex rule expected to start at the beginning of the line,
but the space regex rule matched also the whitespace after the line
break. Now the space rule has been refined not to match the line break.
Because of this, the preprocessor regex rule correctly matches
prerpocessor tokens even when they are preceded by white spaces, at the
cost of adding some more tokens in the token stream in some cases. This
change preserves the behavior of invalid preprocessor usage failing to
tokenize.</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor CFamilyLexer (#1746)</title>
<updated>2021-03-14T07:27:33+00:00</updated>
<author>
<name>amitkummer</name>
<email>49096391+amitkummer@users.noreply.github.com</email>
</author>
<published>2021-03-14T07:27:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=a5af73f1b26b66a348798ccd645217ff1fac8fde'/>
<id>a5af73f1b26b66a348798ccd645217ff1fac8fde</id>
<content type='text'>
* Remove duplicate lines in state

* Refactor ident regex for readability

Refactor ident regex changed in c1a0d82 to improve readability.
Refactor namespaced_ident regex added in c1a0d82 to improve readability.

* Fix inline keword lexing

* Fix indentation

* Refactor CLexer keywords to 'keywords' state</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Remove duplicate lines in state

* Refactor ident regex for readability

Refactor ident regex changed in c1a0d82 to improve readability.
Refactor namespaced_ident regex added in c1a0d82 to improve readability.

* Fix inline keword lexing

* Fix indentation

* Refactor CLexer keywords to 'keywords' state</pre>
</div>
</content>
</entry>
<entry>
<title>Fixes for C and C++ functions and namespaces (#1722)</title>
<updated>2021-02-27T16:32:41+00:00</updated>
<author>
<name>amitkummer</name>
<email>49096391+amitkummer@users.noreply.github.com</email>
</author>
<published>2021-02-27T16:32:41+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=c1a0d82acbe6fa026a1f6843fee00cc1df626549'/>
<id>c1a0d82acbe6fa026a1f6843fee00cc1df626549</id>
<content type='text'>
* Fix lexing of function names

This fixes #1561.

Add a keywords state that matches inside and outside functions for
keywords.

Before this, when a keyword would appear the lexer would go to the
statements state, in which functions were not matched.

* Add tests for lexing of function names

* Unbreak previous tests

* Allow namespaced names in function statements

Add a second identifiers regex that matces all the previous identifiers
and also '::'.

I took the decision to create a second identifiers regex with '::'
inside, simply because using the old identifiers regex would hurt
performance massively on every solution I tried to craft.

* Add tests for namespaced names in functions

* Unbreak previous tests

* Add support for namespaces in namespace declarations

Add a namespace state that is entered each time the namespace keyword
is matched and lexes all name matches as namespaces.

Cases this approach doesn't cover:
* Namespaces in using declarations.
* Namespaces that prefix names in random code.
Unfortunately, in both of these cases the names before and after '::'
are not always namespaces.

* Add tests for namespace declartions

* Unbreak previous tests

* Tidy functions regex

Remove group nesting that became unneeded after fc56ab8 (the last big
refactor).

* Remove f string usage I introduced by mistake</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix lexing of function names

This fixes #1561.

Add a keywords state that matches inside and outside functions for
keywords.

Before this, when a keyword would appear the lexer would go to the
statements state, in which functions were not matched.

* Add tests for lexing of function names

* Unbreak previous tests

* Allow namespaced names in function statements

Add a second identifiers regex that matces all the previous identifiers
and also '::'.

I took the decision to create a second identifiers regex with '::'
inside, simply because using the old identifiers regex would hurt
performance massively on every solution I tried to craft.

* Add tests for namespaced names in functions

* Unbreak previous tests

* Add support for namespaces in namespace declarations

Add a namespace state that is entered each time the namespace keyword
is matched and lexes all name matches as namespaces.

Cases this approach doesn't cover:
* Namespaces in using declarations.
* Namespaces that prefix names in random code.
Unfortunately, in both of these cases the names before and after '::'
are not always namespaces.

* Add tests for namespace declartions

* Unbreak previous tests

* Tidy functions regex

Remove group nesting that became unneeded after fc56ab8 (the last big
refactor).

* Remove f string usage I introduced by mistake</pre>
</div>
</content>
</entry>
<entry>
<title>conftest: disallow error tokens in examplefiles</title>
<updated>2021-01-21T21:20:46+00:00</updated>
<author>
<name>Georg Brandl</name>
<email>georg@python.org</email>
</author>
<published>2021-01-21T21:12:09+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=a44725638565f3814dd806b8a13606eb46fa6c15'/>
<id>a44725638565f3814dd806b8a13606eb46fa6c15</id>
<content type='text'>
They are ok in small snippets to demonstrate error cases.

Also recode all examplefiles to UTF-8.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They are ok in small snippets to demonstrate error cases.

Also recode all examplefiles to UTF-8.
</pre>
</div>
</content>
</entry>
<entry>
<title>Also add auto-updatable output-based tests to examplefiles (#1689)</title>
<updated>2021-01-20T09:48:45+00:00</updated>
<author>
<name>Oleh Prypin</name>
<email>oleh@pryp.in</email>
</author>
<published>2021-01-20T09:48:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=6f4309217326430145564ae8b1bb393ea684f39f'/>
<id>6f4309217326430145564ae8b1bb393ea684f39f</id>
<content type='text'>
Co-authored-by: Georg Brandl &lt;georg@python.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Georg Brandl &lt;georg@python.org&gt;</pre>
</div>
</content>
</entry>
</feed>
