Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(260315)

Side by Side Diff: Include/frameobject.h

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 1
2 /* Frame object interface */ 2 /* Frame object interface */
3 3
4 #ifndef Py_LIMITED_API 4 #ifndef Py_LIMITED_API
5 #ifndef Py_FRAMEOBJECT_H 5 #ifndef Py_FRAMEOBJECT_H
6 #define Py_FRAMEOBJECT_H 6 #define Py_FRAMEOBJECT_H
7 #ifdef __cplusplus 7 #ifdef __cplusplus
8 extern "C" { 8 extern "C" {
9 #endif 9 #endif
10 10
11 typedef struct { 11 typedef struct {
12 int b_type; /* what kind of block this is */ 12 int b_type; /* what kind of block this is */
13 int b_handler; /* where to jump to find handler */ 13 int b_handler; /* where to jump to find handler */
14 int b_level; /* value stack level to pop to */ 14 int b_level; /* value stack level to pop to */
15 } PyTryBlock; 15 } PyTryBlock;
16 16
17 typedef struct _frame { 17 typedef struct _frame {
18 PyObject_VAR_HEAD 18 PyObject_VAR_HEAD
19 struct _frame *f_back; /* previous frame, or NULL */ 19 struct _frame *f_back; /* previous frame, or NULL */
20 PyCodeObject *f_code; /* code segment */ 20 PyCodeObject *f_code; /* code segment */
21 PyObject *f_builtins; /* builtin symbol table (PyDictObject) */ 21 PyObject *f_builtins; /* builtin symbol table (PyDictObject) */
22 PyObject *f_globals; /* global symbol table (PyDictObject) */ 22 PyObject *f_globals; /* global symbol table (PyDictObject) */
23 PyObject *f_locals; /* local symbol table (any mapping) */ 23 PyObject *f_locals; /* local symbol table (any mapping) */
24 PyObject **f_valuestack; /* points after the last local */ 24 PyObject **f_valuestack; /* points after the last local */
25 /* Next free slot in f_valuestack. Frame creation sets to f_valuestack. 25 /* Next free slot in f_valuestack. Frame creation sets to f_valuestack.
26 Frame evaluation usually NULLs it, but a frame that yields sets it 26 Frame evaluation usually NULLs it, but a frame that yields sets it
27 to the current stack top. */ 27 to the current stack top. */
28 PyObject **f_stacktop; 28 PyObject **f_stacktop;
29 PyObject *f_trace; /* Trace function */ 29 PyObject *f_trace; /* Trace function */
30 PyObject *f_yieldfrom; /* Iterator being delegated to by yield from */
30 31
31 /* In a generator, we need to be able to swap between the exception 32 /* In a generator, we need to be able to swap between the exception
32 state inside the generator and the exception state of the calling 33 state inside the generator and the exception state of the calling
33 frame (which shouldn't be impacted when the generator "yields" 34 frame (which shouldn't be impacted when the generator "yields"
34 from an except handler). 35 from an except handler).
35 These three fields exist exactly for that, and are unused for 36 These three fields exist exactly for that, and are unused for
36 non-generator frames. See the SAVE_EXC_STATE and SWAP_EXC_STATE 37 non-generator frames. See the SAVE_EXC_STATE and SWAP_EXC_STATE
37 macros in ceval.c for details of their use. */ 38 macros in ceval.c for details of their use. */
38 PyObject *f_exc_type, *f_exc_value, *f_exc_traceback; 39 PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
39 40
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 PyAPI_FUNC(int) PyFrame_ClearFreeList(void); 81 PyAPI_FUNC(int) PyFrame_ClearFreeList(void);
81 82
82 /* Return the line of code the frame is currently executing. */ 83 /* Return the line of code the frame is currently executing. */
83 PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); 84 PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
84 85
85 #ifdef __cplusplus 86 #ifdef __cplusplus
86 } 87 }
87 #endif 88 #endif
88 #endif /* !Py_FRAMEOBJECT_H */ 89 #endif /* !Py_FRAMEOBJECT_H */
89 #endif /* Py_LIMITED_API */ 90 #endif /* Py_LIMITED_API */
OLDNEW
« no previous file with comments | « Grammar/Grammar ('k') | Include/genobject.h » ('j') | Modules/parsermodule.c » ('J')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+