Home
last modified time | relevance | path

Searched refs:codestr (Results 1 – 12 of 12) sorted by relevance

/external/python/cpython2/Python/
Dpeephole.c37 tuple_of_constants(unsigned char *codestr, Py_ssize_t n, PyObject *consts) in tuple_of_constants() argument
44 assert(codestr[n*3] == BUILD_TUPLE || codestr[n*3] == BUILD_LIST); in tuple_of_constants()
45 assert(GETARG(codestr, (n*3)) == n); in tuple_of_constants()
47 assert(codestr[i*3] == LOAD_CONST); in tuple_of_constants()
55 arg = GETARG(codestr, (i*3)); in tuple_of_constants()
71 memset(codestr, NOP, n*3); in tuple_of_constants()
72 codestr[n*3] = LOAD_CONST; in tuple_of_constants()
73 SETARG(codestr, (n*3), len_consts); in tuple_of_constants()
88 fold_binops_on_constants(unsigned char *codestr, PyObject *consts) in fold_binops_on_constants() argument
96 assert(codestr[0] == LOAD_CONST); in fold_binops_on_constants()
[all …]
/external/python/cpython3/Python/
Dwordcode_helpers.h25 write_op_arg(_Py_CODEUNIT *codestr, unsigned char opcode, in write_op_arg() argument
30 *codestr++ = PACKOPARG(EXTENDED_ARG, (oparg >> 24) & 0xff); in write_op_arg()
33 *codestr++ = PACKOPARG(EXTENDED_ARG, (oparg >> 16) & 0xff); in write_op_arg()
36 *codestr++ = PACKOPARG(EXTENDED_ARG, (oparg >> 8) & 0xff); in write_op_arg()
39 *codestr++ = PACKOPARG(opcode, oparg & 0xff); in write_op_arg()
/external/python/cpython2/Lib/test/
Dtest_new.py65 codestr = '''
72 codestr = "\n".join(l.strip() for l in codestr.splitlines())
74 ccode = compile(codestr, '<string>', 'exec')
Dtest_decorators.py161 codestr = "@%s\ndef f(): pass" % expr
162 self.assertRaises(SyntaxError, compile, codestr, "test", "exec")
179 codestr = "@%s\ndef f(): pass\nassert f() is None" % expr
180 code = compile(codestr, "test", "exec")
Dtest_with.py133 def assertRaisesSyntaxError(self, codestr): argument
136 self.assertRaises(SyntaxError, shouldRaiseSyntaxError, codestr)
/external/python/cpython3/Lib/test/
Dtest_keywordonlyarg.py38 def assertRaisesSyntaxError(self, codestr): argument
41 self.assertRaises(SyntaxError, shouldRaiseSyntaxError, codestr)
Dtest_decorators.py198 codestr = "@%s\ndef f(): pass\nassert f() is None" % expr
199 code = compile(codestr, "test", "exec")
Dtest_positional_only_arg.py21 def assertRaisesSyntaxError(self, codestr, regex="invalid syntax"): argument
23 compile(codestr + "\n", "<test>", "single")
Dtest_with.py141 def assertRaisesSyntaxError(self, codestr): argument
144 self.assertRaises(SyntaxError, shouldRaiseSyntaxError, codestr)
Dtest_builtin.py346 codestr = '''def f():
366 codeobjs.append(compile(codestr, "<test>", "exec", optimize=optval))
367 tree = ast.parse(codestr)
/external/python/cpython3/Objects/
Dframeobject.c78 get_arg(const _Py_CODEUNIT *codestr, Py_ssize_t i) in get_arg() argument
81 unsigned int oparg = _Py_OPARG(codestr[i]); in get_arg()
82 if (i >= 1 && _Py_OPCODE(word = codestr[i-1]) == EXTENDED_ARG) { in get_arg()
84 if (i >= 2 && _Py_OPCODE(word = codestr[i-2]) == EXTENDED_ARG) { in get_arg()
86 if (i >= 3 && _Py_OPCODE(word = codestr[i-3]) == EXTENDED_ARG) { in get_arg()
/external/python/cpython3/Modules/
D_xxsubinterpretersmodule.c1863 _run_script(PyInterpreterState *interp, const char *codestr, in _run_script() argument
1890 PyObject *result = PyRun_StringFlags(codestr, Py_file_input, ns, ns, NULL); in _run_script()
1922 _run_script_in_interpreter(PyInterpreterState *interp, const char *codestr, in _run_script_in_interpreter() argument
1943 int result = _run_script(interp, codestr, shared, &exc); in _run_script_in_interpreter()
1959 int result = _run_script(interp, codestr, shared, &exc); in _run_script_in_interpreter()
2192 const char *codestr = PyUnicode_AsUTF8AndSize(code, &size); in interp_run_string() local
2193 if (codestr == NULL) { in interp_run_string()
2196 if (strlen(codestr) != (size_t)size) { in interp_run_string()
2203 if (_run_script_in_interpreter(interp, codestr, shared) != 0) { in interp_run_string()