| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  | /*[clinic input]
 | 
					
						
							|  |  |  | preserve | 
					
						
							|  |  |  | [clinic start generated code]*/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyDoc_STRVAR(_symtable_symtable__doc__, | 
					
						
							| 
									
										
										
										
											2019-05-28 16:21:17 -07:00
										 |  |  | "symtable($module, source, filename, startstr, /)\n" | 
					
						
							| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  | "--\n" | 
					
						
							|  |  |  | "\n" | 
					
						
							|  |  |  | "Return symbol and scope dictionaries used internally by compiler."); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define _SYMTABLE_SYMTABLE_METHODDEF    \
 | 
					
						
							| 
									
										
										
										
											2018-11-27 11:27:36 +02:00
										 |  |  |     {"symtable", (PyCFunction)(void(*)(void))_symtable_symtable, METH_FASTCALL, _symtable_symtable__doc__}, | 
					
						
							| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2019-05-28 16:21:17 -07:00
										 |  |  | _symtable_symtable_impl(PyObject *module, PyObject *source, | 
					
						
							| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  |                         PyObject *filename, const char *startstr); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject * | 
					
						
							| 
									
										
										
										
											2017-12-15 13:11:11 +02:00
										 |  |  | _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) | 
					
						
							| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     PyObject *return_value = NULL; | 
					
						
							| 
									
										
										
										
											2019-05-28 16:21:17 -07:00
										 |  |  |     PyObject *source; | 
					
						
							| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  |     PyObject *filename; | 
					
						
							|  |  |  |     const char *startstr; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-11 16:01:14 +02:00
										 |  |  |     if (!_PyArg_CheckPositional("symtable", nargs, 3, 3)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2019-05-28 16:21:17 -07:00
										 |  |  |     source = args[0]; | 
					
						
							| 
									
										
										
										
											2019-01-11 16:01:14 +02:00
										 |  |  |     if (!PyUnicode_FSDecoder(args[1], &filename)) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (!PyUnicode_Check(args[2])) { | 
					
						
							| 
									
										
										
										
											2019-08-29 16:49:08 +02:00
										 |  |  |         _PyArg_BadArgument("symtable", "argument 3", "str", args[2]); | 
					
						
							| 
									
										
										
										
											2019-01-11 16:01:14 +02:00
										 |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     Py_ssize_t startstr_length; | 
					
						
							|  |  |  |     startstr = PyUnicode_AsUTF8AndSize(args[2], &startstr_length); | 
					
						
							|  |  |  |     if (startstr == NULL) { | 
					
						
							|  |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (strlen(startstr) != (size_t)startstr_length) { | 
					
						
							|  |  |  |         PyErr_SetString(PyExc_ValueError, "embedded null character"); | 
					
						
							| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  |         goto exit; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2019-05-28 16:21:17 -07:00
										 |  |  |     return_value = _symtable_symtable_impl(module, source, filename, startstr); | 
					
						
							| 
									
										
										
										
											2017-02-04 12:13:20 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | exit: | 
					
						
							|  |  |  |     return return_value; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-08-29 16:49:08 +02:00
										 |  |  | /*[clinic end generated code: output=a12f75cdbdf4e52a input=a9049054013a1b77]*/ |