From a78c7954d549fba967a842143b4e3050ff488468 Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Tue, 3 Nov 2015 12:45:05 -0500 Subject: Issue 25483: Add an opcode to make f-string formatting more robust. --- Include/ceval.h | 8 ++++++++ Include/opcode.h | 1 + 2 files changed, 9 insertions(+) (limited to 'Include') diff --git a/Include/ceval.h b/Include/ceval.h index b5373a9cc4..d194044911 100644 --- a/Include/ceval.h +++ b/Include/ceval.h @@ -206,6 +206,14 @@ PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *); PyAPI_FUNC(void) _PyEval_SignalAsyncExc(void); #endif +/* Masks and values used by FORMAT_VALUE opcode. */ +#define FVC_MASK 0x3 +#define FVC_NONE 0x0 +#define FVC_STR 0x1 +#define FVC_REPR 0x2 +#define FVC_ASCII 0x3 +#define FVS_MASK 0x4 +#define FVS_HAVE_SPEC 0x4 #ifdef __cplusplus } diff --git a/Include/opcode.h b/Include/opcode.h index 3f917fb6ee..b265368b61 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -122,6 +122,7 @@ extern "C" { #define BUILD_TUPLE_UNPACK 152 #define BUILD_SET_UNPACK 153 #define SETUP_ASYNC_WITH 154 +#define FORMAT_VALUE 155 /* EXCEPT_HANDLER is a special, implicit block type which is created when entering an except handler. It is not an opcode but we define it here -- cgit v1.2.1