msg157551 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2012-04-05 08:04 |
In http://docs.python.org/dev/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator , two code samples |
|
|
msg157552 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2012-04-05 08:04 |
Whoops - In http://docs.python.org/dev/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator , two code samples are not highlighted. |
|
|
msg157579 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-04-05 12:59 |
I'm not seeing any unhighlighted examples in that section. |
|
|
msg157584 - (view) |
Author: Berker Peksag (berker.peksag) *  |
Date: 2012-04-05 13:07 |
I can reproduce. See screenshot.png. |
|
|
msg157587 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-04-05 13:47 |
Berker: you can reproduce the bug, or the fact that they are highlighted? The png looks like they are highlighted, so I assume the latter. |
|
|
msg157589 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2012-04-05 13:56 |
> they are highlighted No. Keywords normally appear in bold font, and with another color. This is not the case in these blocks. Probably because the language detection does not work with the new "yield from" construct. Sphinx should always use the latest Python... |
|
|
msg157593 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-04-05 14:11 |
Ah, you mean they are not *syntax* highlighted. Now I understand. Sorry for missing that. My understanding is that Sphinx does not use Python directly to parse the code and highlight it, it uses pygments, which uses regexes. So this basically amounts to a feature request for pygments. |
|
|
msg157595 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2012-04-05 14:32 |
Not exactly. Sphinx first tries to see if the block is a Python script, and to do so it uses the Python compiler: https://bitbucket.org/birkenfeld/sphinx/src/164f59b2d946/sphinx/highlighting.py#cl-117 In case of SyntaxError, it treats the whole block as plain text and does not try to use pygmentq at all. |
|
|
msg157596 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2012-04-05 14:44 |
Huh. Well, in another issue Georg said it was now possible to upgrade the doc build toolchain to Python3. |
|
|
msg171647 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2012-09-30 16:15 |
I've updated the version of Pygments used by 3.3 and 3.4 branches, which fixes this and the "raise from" issue. |
|
|