]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40334: Make the PyPegen* and PyParser* APIs more consistent (GH-19839)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Fri, 1 May 2020 17:30:51 +0000 (20:30 +0300)
committerGitHub <noreply@github.com>
Fri, 1 May 2020 17:30:51 +0000 (18:30 +0100)
commit03b7642265e65f198682f22648dbe6cf4fff9835
tree9eb424f013229729e2eef40ec91de43f69983027
parentd9d6eadf003605f4cdb55e38df2168dd1bc0dbd5
bpo-40334: Make the PyPegen* and PyParser* APIs more consistent (GH-19839)

This commit makes both APIs more consistent by doing the following:
- Remove the `PyPegen_CodeObjectFrom*` functions, which weren't used
  and will probably not be needed. Functions like `Py_CompileStringObject`
  can be used instead.
- Include a `const char *filename` parameter in `PyPegen_ASTFromString`.
- Rename `PyPegen_ASTFromFile` to `PyPegen_ASTFromFilename`, because
  its signature is not the same with `PyParser_ASTFromFile`.
Include/internal/pegen_interface.h
Modules/_peg_parser.c
Parser/pegen/peg_api.c