diff options
author | nikitozzz <nikitozzz@yandex-team.ru> | 2022-02-10 16:48:21 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:21 +0300 |
commit | 20fb5622594feb17be2ce26b99ddd6f60a870b3a (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /contrib/tools/python/src/Include/node.h | |
parent | 4f75eb4f8565e268d8b66c3a502d9d5afa270139 (diff) | |
download | ydb-20fb5622594feb17be2ce26b99ddd6f60a870b3a.tar.gz |
Restoring authorship annotation for <nikitozzz@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python/src/Include/node.h')
-rw-r--r-- | contrib/tools/python/src/Include/node.h | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/contrib/tools/python/src/Include/node.h b/contrib/tools/python/src/Include/node.h index bae3080a81..517c3dc43e 100644 --- a/contrib/tools/python/src/Include/node.h +++ b/contrib/tools/python/src/Include/node.h @@ -1,41 +1,41 @@ - -/* Parse tree node interface */ - -#ifndef Py_NODE_H -#define Py_NODE_H -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _node { - short n_type; - char *n_str; - int n_lineno; - int n_col_offset; - int n_nchildren; - struct _node *n_child; -} node; - -PyAPI_FUNC(node *) PyNode_New(int type); -PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, - char *str, int lineno, int col_offset); -PyAPI_FUNC(void) PyNode_Free(node *n); + +/* Parse tree node interface */ + +#ifndef Py_NODE_H +#define Py_NODE_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _node { + short n_type; + char *n_str; + int n_lineno; + int n_col_offset; + int n_nchildren; + struct _node *n_child; +} node; + +PyAPI_FUNC(node *) PyNode_New(int type); +PyAPI_FUNC(int) PyNode_AddChild(node *n, int type, + char *str, int lineno, int col_offset); +PyAPI_FUNC(void) PyNode_Free(node *n); PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); - -/* Node access functions */ -#define NCH(n) ((n)->n_nchildren) - -#define CHILD(n, i) (&(n)->n_child[i]) -#define RCHILD(n, i) (CHILD(n, NCH(n) + i)) -#define TYPE(n) ((n)->n_type) -#define STR(n) ((n)->n_str) - -/* Assert that the type of a node is what we expect */ -#define REQ(n, type) assert(TYPE(n) == (type)) - -PyAPI_FUNC(void) PyNode_ListTree(node *); - -#ifdef __cplusplus -} -#endif -#endif /* !Py_NODE_H */ + +/* Node access functions */ +#define NCH(n) ((n)->n_nchildren) + +#define CHILD(n, i) (&(n)->n_child[i]) +#define RCHILD(n, i) (CHILD(n, NCH(n) + i)) +#define TYPE(n) ((n)->n_type) +#define STR(n) ((n)->n_str) + +/* Assert that the type of a node is what we expect */ +#define REQ(n, type) assert(TYPE(n) == (type)) + +PyAPI_FUNC(void) PyNode_ListTree(node *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_NODE_H */ |