Skip to content

Commit c0e1638

Browse files
Fix remaining broken links. (#1013)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> closes #681
1 parent cfe1bf0 commit c0e1638

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

developer-workflow/grammar.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@ Note: sometimes things mysteriously don't work. Before giving up, try ``make cl
2828
* :cpy-file:`Grammar/python.gram`: The grammar, with actions that build AST nodes.
2929
After changing it, run ``make regen-pegen`` (or ``build.bat --regen`` on Windows),
3030
to regenerate :cpy-file:`Parser/parser.c`.
31-
(This runs Python's parser generator, ``Tools/peg_generator``).
31+
(This runs Python's parser generator, :cpy-file:`Tools/peg_generator`).
3232

3333
* :cpy-file:`Grammar/Tokens` is a place for adding new token types. After
34-
changing it, run ``make regen-token`` to regenerate :cpy-file:`Include/token.h`,
35-
:cpy-file:`Parser/token.c`, :cpy-file:`Lib/token.py` and
36-
:cpy-file:`Doc/library/token-list.inc`. If you change both ``python.gram``
37-
and ``Tokens``, run ``make regen-token`` before ``make regen-pegen``.
34+
changing it, run ``make regen-token`` to regenerate
35+
:cpy-file:`Include/internal/pycore_token.h`, :cpy-file:`Parser/token.c`,
36+
:cpy-file:`Lib/token.py` and :cpy-file:`Doc/library/token-list.inc`.
37+
If you change both ``python.gram`` and ``Tokens``,
38+
run ``make regen-token`` before ``make regen-pegen``.
3839
On Windows, ``build.bat --regen`` will regenerate both at the same time.
3940

4041
* :cpy-file:`Parser/Python.asdl` may need changes to match the grammar.
41-
Then run ``make regen-ast`` to regenerate :cpy-file:`Include/Python-ast.h`
42-
and :cpy-file:`Python/Python-ast.c`.
42+
Then run ``make regen-ast`` to regenerate
43+
:cpy-file:`Include/internal/pycore_ast.h` and :cpy-file:`Python/Python-ast.c`.
4344

4445
* :cpy-file:`Parser/tokenizer.c` contains the tokenization code.
4546
This is where you would add a new type of comment or string literal, for example.

internals/compiler.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ Finally, you need to introduce the use of the new bytecode. Altering
490490
places to change. You must add the case for a new opcode into the 'switch'
491491
statement in the ``stack_effect()`` function in :cpy-file:`Python/compile.c`.
492492
If the new opcode has a jump target, you will need to update macros and
493-
'switch' statements in :cpy-file:`Python/peephole.c`. If it affects a control
493+
'switch' statements in :cpy-file:`Python/compile.c`. If it affects a control
494494
flow or the block stack, you may have to update the ``frame_setlineno()``
495495
function in :cpy-file:`Objects/frameobject.c`. :cpy-file:`Lib/dis.py` may need
496496
an update if the new opcode interprets its argument in a special way (like
@@ -514,7 +514,8 @@ Code Objects
514514
============
515515

516516
The result of ``PyAST_CompileObject()`` is a ``PyCodeObject`` which is defined in
517-
:cpy-file:`Include/code.h`. And with that you now have executable Python bytecode!
517+
:cpy-file:`Include/cpython/code.h`. And with that you now have executable
518+
Python bytecode!
518519

519520
The code objects (byte code) are executed in :cpy-file:`Python/ceval.c`. This file
520521
will also need a new case statement for the new opcode in the big switch
@@ -579,18 +580,14 @@ Important Files
579580

580581
* :cpy-file:`Python/symtable.c`: Generates a symbol table from AST.
581582

582-
* :cpy-file:`Python/peephole.c`: Optimizes the bytecode.
583-
584583
* :cpy-file:`Python/pyarena.c`: Implementation of the arena memory manager.
585584

586-
* :cpy-file:`Python/wordcode_helpers.h`: Helpers for generating bytecode.
587-
588585
* :cpy-file:`Python/opcode_targets.h`: One of the files that must be
589586
modified if :cpy-file:`Lib/opcode.py` is.
590587

591588
* :cpy-file:`Include/`
592-
* :cpy-file:`Include/code.h`: Header file for :cpy-file:`Objects/codeobject.c`;
593-
contains definition of ``PyCodeObject``.
589+
* :cpy-file:`Include/cpython/code.h`: Header file for
590+
:cpy-file:`Objects/codeobject.c`; contains definition of ``PyCodeObject``.
594591

595592
* :cpy-file:`Include/opcode.h`: One of the files that must be modified if
596593
:cpy-file:`Lib/opcode.py` is.

0 commit comments

Comments
 (0)