Logo
Explore Help
Sign In
1berry/cpython
1
0
Fork 0
You've already forked cpython
Code Issues Packages Projects Releases Wiki Activity
cpython/Python/asdl.c

27 lines
382 B
C
Raw Normal View History

Merge ast-branch to head This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
2005-10-20 19:59:25 +00:00
#include "Python.h"
#include "asdl.h"
asdl_seq *
asdl_seq_new(int size)
{
asdl_seq *seq = NULL;
size_t n = sizeof(asdl_seq) +
(size ? (sizeof(void *) * (size - 1)) : 0);
seq = (asdl_seq *)PyObject_Malloc(n);
if (!seq) {
Use convenience function
2005-11-14 00:47:57 +00:00
PyErr_NoMemory();
Merge ast-branch to head This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
2005-10-20 19:59:25 +00:00
return NULL;
}
memset(seq, 0, n);
seq->size = size;
return seq;
}
void
asdl_seq_free(asdl_seq *seq)
{
PyObject_Free(seq);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 121ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API