Skip to content

Commit 1a57b84

Browse files
authored
Minor fixes to compiler internals doc (#1336)
- Correct double negations - Fix reference to ADDOP_LOAD_CONST_NEW - Improve grammar
1 parent 79987a6 commit 1a57b84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: internals/compiler.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Emission of bytecode is handled by the following macros:
398398
add a specified opcode
399399
``ADDOP_NOLINE(struct compiler *, int)``
400400
like ``ADDOP`` without a line number; used for artificial opcodes without
401-
no corresponding token in the source code
401+
a corresponding token in the source code
402402
``ADDOP_IN_SCOPE(struct compiler *, int)``
403403
like ``ADDOP``, but also exits current scope; used for adding return value
404404
opcodes in lambdas and closures
@@ -421,17 +421,17 @@ Emission of bytecode is handled by the following macros:
421421
add the ``LOAD_CONST`` opcode with the proper argument based on the
422422
position of the specified PyObject in the consts table.
423423
``ADDOP_LOAD_CONST_NEW(struct compiler *, PyObject *)``
424-
just like ``ADDOP_LOAD_CONST_NEW``, but steals a reference to PyObject
424+
just like ``ADDOP_LOAD_CONST``, but steals a reference to PyObject
425425
``ADDOP_JUMP(struct compiler *, int, basicblock *)``
426426
create a jump to a basic block
427427
``ADDOP_JUMP_NOLINE(struct compiler *, int, basicblock *)``
428428
like ``ADDOP_JUMP`` without a line number; used for artificial jumps
429-
without no corresponding token in the source code.
429+
without a corresponding token in the source code.
430430
``ADDOP_JUMP_COMPARE(struct compiler *, cmpop_ty)``
431431
depending on the second argument, add an ``ADDOP_I`` with either an
432432
``IS_OP``, ``CONTAINS_OP``, or ``COMPARE_OP`` opcode.
433433

434-
Several helper functions that will emit bytecode and are named
434+
Several helper functions that will emit bytecode are named
435435
:samp:`compiler_{xx}()` where *xx* is what the function helps with (``list``,
436436
``boolop``, etc.). A rather useful one is ``compiler_nameop()``.
437437
This function looks up the scope of a variable and, based on the

0 commit comments

Comments
 (0)