/* Generated by Cython 0.12.1 on Sat Jul 24 13:41:03 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) #define PyDict_Contains(d,o) PySequence_Contains(d,o) #endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #endif #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) #define PyVarObject_HEAD_INIT(type, size) \ PyObject_HEAD_INIT(type) size, #define PyType_Modified(t) typedef struct { void *buf; PyObject *obj; Py_ssize_t len; Py_ssize_t itemsize; int readonly; int ndim; char *format; Py_ssize_t *shape; Py_ssize_t *strides; Py_ssize_t *suboffsets; void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 #define PyBUF_WRITABLE 0x0001 #define PyBUF_FORMAT 0x0004 #define PyBUF_ND 0x0008 #define PyBUF_STRIDES (0x0010 | PyBUF_ND) #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #endif #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #endif #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyString_Type PyUnicode_Type #define PyString_CheckExact PyUnicode_CheckExact #else #define PyBytes_Type PyString_Type #define PyBytes_CheckExact PyString_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #else #define _USE_MATH_DEFINES #endif #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) #else #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) #else #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #include #define __PYX_HAVE_API__codetalker__cgrammar #include "stdlib.h" #include "c/_speed_tokens.h" #include "c/parser.h" #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #else #define CYTHON_INLINE #endif #endif typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyBytes_FromString PyString_FromString #define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize #define __Pyx_PyBytes_AsString PyString_AsString #else #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize #define __Pyx_PyBytes_AsString PyBytes_AsString #endif #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); #if !defined(T_PYSSIZET) #if PY_VERSION_HEX < 0x02050000 #define T_PYSSIZET T_INT #elif !defined(T_LONGLONG) #define T_PYSSIZET \ ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) #else #define T_PYSSIZET \ ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) #endif #endif #if !defined(T_ULONGLONG) #define __Pyx_T_UNSIGNED_INT(x) \ ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) #else #define __Pyx_T_UNSIGNED_INT(x) \ ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) #endif #if !defined(T_LONGLONG) #define __Pyx_T_SIGNED_INT(x) \ ((sizeof(x) == sizeof(char)) ? T_BYTE : \ ((sizeof(x) == sizeof(short)) ? T_SHORT : \ ((sizeof(x) == sizeof(int)) ? T_INT : \ ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) #else #define __Pyx_T_SIGNED_INT(x) \ ((sizeof(x) == sizeof(char)) ? T_BYTE : \ ((sizeof(x) == sizeof(short)) ? T_SHORT : \ ((sizeof(x) == sizeof(int)) ? T_INT : \ ((sizeof(x) == sizeof(long)) ? T_LONG : \ ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) #endif #define __Pyx_T_FLOATING(x) \ ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) #if !defined(T_SIZET) #if !defined(T_ULONGLONG) #define T_SIZET \ ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) #else #define T_SIZET \ ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) #endif #endif static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #ifdef __GNUC__ /* Test for GCC > 2.95 */ #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ > 2 ... */ #else /* __GNUC__ */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char **__pyx_f; /* Type declarations */ /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":412 * return crule * * cdef RuleOption convert_option(object option, to_or=False): # <<<<<<<<<<<<<< * cdef RuleOption coption * coption.num = len(option) */ struct __pyx_opt_args_10codetalker_8cgrammar_convert_option { int __pyx_n; PyObject *to_or; }; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":420 * return coption * * cdef RuleItem convert_item(object item, bint from_or=False): # <<<<<<<<<<<<<< * cdef RuleItem citem * cdef RuleOption* option */ struct __pyx_opt_args_10codetalker_8cgrammar_convert_item { int __pyx_n; int from_or; }; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":617 * ### TOKENIZE ### * * cdef struct TokenState: # <<<<<<<<<<<<<< * int at * int ln */ struct __pyx_t_10codetalker_8cgrammar_TokenState { int at; int ln; char *text; int lineno; int charno; int *indents; int num_indents; int max_indents; }; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":627 * int max_indents * * cdef struct cache_one: # <<<<<<<<<<<<<< * char* cache * char** strings */ struct __pyx_t_10codetalker_8cgrammar_cache_one { char *cache; char **strings; int num; }; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) #else #define __Pyx_RefNannySetupContext(name) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #endif /* CYTHON_REFNANNY */ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) #ifndef CYTHON_PROFILE #define CYTHON_PROFILE 1 #endif #ifndef CYTHON_PROFILE_REUSE_FRAME #define CYTHON_PROFILE_REUSE_FRAME 0 #endif #if CYTHON_PROFILE #include "compile.h" #include "frameobject.h" #include "traceback.h" #if CYTHON_PROFILE_REUSE_FRAME #define CYTHON_FRAME_MODIFIER static #define CYTHON_FRAME_DEL #else #define CYTHON_FRAME_MODIFIER #define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame) #endif #define __Pyx_TraceDeclarations \ static PyCodeObject *__pyx_frame_code = NULL; \ CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \ int __Pyx_use_tracing = 0; #define __Pyx_TraceCall(funcname, srcfile, firstlineno) \ if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) { \ __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \ } #define __Pyx_TraceException() \ if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \ PyObject *exc_info = __Pyx_GetExceptionTuple(); \ if (exc_info) { \ PyThreadState_GET()->c_profilefunc( \ PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \ Py_DECREF(exc_info); \ } \ } #define __Pyx_TraceReturn(result) \ if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \ PyThreadState_GET()->c_profilefunc( \ PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \ CYTHON_FRAME_DEL; \ } static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/ static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/ #else #define __Pyx_TraceDeclarations #define __Pyx_TraceCall(funcname, srcfile, firstlineno) #define __Pyx_TraceException() #define __Pyx_TraceReturn(result) #endif /* CYTHON_PROFILE */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ #define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \ __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) { if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { Py_INCREF(v); Py_DECREF(PyList_GET_ITEM(o, i)); PyList_SET_ITEM(o, i, v); return 1; } else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0))) return PySequence_SetItem(o, i, v); else { PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i); return __Pyx_SetItemInt_Generic(o, j, v); } } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } #define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); Py_INCREF(r); return r; } } return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); Py_INCREF(r); return r; } } return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } #define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); Py_INCREF(r); } else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); } else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { r = PySequence_GetItem(o, i); } else { r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } return r; } #include static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ static int __Pyx_EndUnpack(PyObject *); /*proto*/ static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); } static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (PyList_Append(L, x) < 0) return NULL; Py_INCREF(Py_None); return Py_None; /* this is just to have an accurate signature */ } else { PyObject *r, *m; m = __Pyx_GetAttrString(L, "append"); if (!m) return NULL; r = PyObject_CallFunctionObjArgs(m, x, NULL); Py_DECREF(m); return r; } } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static int __Pyx_Print(PyObject *, int); /*proto*/ #if PY_MAJOR_VERSION >= 3 static PyObject* __pyx_print = 0; static PyObject* __pyx_print_kwargs = 0; #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); static void __Pyx_WriteUnraisable(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ /* Module declarations from stdlib */ /* Module declarations from codetalker.cgrammar */ static struct Token __pyx_v_10codetalker_8cgrammar_NO_TOKEN; static CYTHON_INLINE int __pyx_f_10codetalker_8cgrammar_strichr(char *, char); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar_try_get_tokens(int, char *, struct Token **); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar_try_get_parse_tree(int, char *, int, struct TokenStream *, struct cParseNode **); /*proto*/ static char *__pyx_f_10codetalker_8cgrammar_format_parse_error(int, struct TokenStream *, struct Error *); /*proto*/ static struct Token *__pyx_f_10codetalker_8cgrammar_get_last_token(struct TokenStream *); /*proto*/ static struct TokenStream __pyx_f_10codetalker_8cgrammar_tokens_to_stream(struct Token *); /*proto*/ static struct Rules __pyx_f_10codetalker_8cgrammar_convert_rules(PyObject *); /*proto*/ static struct Rule __pyx_f_10codetalker_8cgrammar_convert_rule(PyObject *, unsigned int); /*proto*/ static struct RuleOption __pyx_f_10codetalker_8cgrammar_convert_option(PyObject *, struct __pyx_opt_args_10codetalker_8cgrammar_convert_option *__pyx_optional_args); /*proto*/ static struct RuleItem __pyx_f_10codetalker_8cgrammar_convert_item(PyObject *, struct __pyx_opt_args_10codetalker_8cgrammar_convert_item *__pyx_optional_args); /*proto*/ static struct IgnoreTokens __pyx_f_10codetalker_8cgrammar_convert_ignore(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar_convert_ast_attrs(PyObject *, PyObject *, PyObject *, struct AstAttrs **); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar_which_rt(PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar_convert_ast_attr(char *, PyObject *, PyObject *, PyObject *, struct AstAttr *); /*proto*/ static struct PTokens __pyx_f_10codetalker_8cgrammar_convert_ptokens(PyObject *); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar_convert_back_tokens(int, struct Token *); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar_convert_back_ptree(int, struct cParseNode *); /*proto*/ static void __pyx_f_10codetalker_8cgrammar_kill_tokens(struct Token *); /*proto*/ static void __pyx_f_10codetalker_8cgrammar_kill_ptree(struct cParseNode *); /*proto*/ static struct Token *__pyx_f_10codetalker_8cgrammar__get_tokens(int, char *, struct cTokenError *, char *); /*proto*/ static struct Token *__pyx_f_10codetalker_8cgrammar_advance(int, struct Token *, int, struct __pyx_t_10codetalker_8cgrammar_TokenState *, int, int, struct cTokenError *); /*proto*/ static void __pyx_f_10codetalker_8cgrammar_add_indent(struct __pyx_t_10codetalker_8cgrammar_TokenState *, int); /*proto*/ static PyObject *__pyx_f_10codetalker_8cgrammar__get_ast(struct Grammar *, int, struct cParseNode *, PyObject *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "codetalker.cgrammar" int __pyx_module_is_main_codetalker__cgrammar = 0; /* Implementation of codetalker.cgrammar */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_Exception; static PyObject *__pyx_builtin_getattr; static char __pyx_k_1[] = ""; static char __pyx_k_2[] = "(no error)"; static char __pyx_k_3[] = "Ran out of tokens (expected %s)"; static char __pyx_k_4[] = "just ran out of tokens... (expected '%s')"; static char __pyx_k_5[] = "Unknown Error"; static char __pyx_k_6[] = "Extra data (expected EOF)"; static char __pyx_k_7[] = "Failed while parsing rule '%s' (don't know what to do with '%s' <%s>)"; static char __pyx_k_8[] = "Invalid token %s <%s> (expected <%s>)"; static char __pyx_k_9[] = "Invalid token '%s' <%s> (expected '%s')"; static char __pyx_k_11[] = "*"; static char __pyx_k_12[] = "+"; static char __pyx_k_13[] = "|"; static char __pyx_k_14[] = "?"; static char __pyx_k_15[] = "!"; static char __pyx_k_16[] = "invalid AST type: %s"; static char __pyx_k_17[] = ""; static char __pyx_k_18[] = "Unknown token type"; static char __pyx_k_19[] = "no valid token found"; static char __pyx_k_20[] = "invalid indentation -- %d (expected %d)"; static char __pyx_k_21[] = "codetalker.pgm.tokens"; static char __pyx_k_22[] = "codetalker.pgm.errors"; static char __pyx_k__i[] = "i"; static char __pyx_k__ID[] = "ID"; static char __pyx_k__at[] = "at"; static char __pyx_k__ln[] = "ln"; static char __pyx_k__ANY[] = "ANY"; static char __pyx_k__EOF[] = "EOF"; static char __pyx_k__HEX[] = "HEX"; static char __pyx_k__INT[] = "INT"; static char __pyx_k__end[] = "end"; static char __pyx_k__eof[] = "eof"; static char __pyx_k__get[] = "get"; static char __pyx_k__gid[] = "gid"; static char __pyx_k__num[] = "num"; static char __pyx_k__tid[] = "tid"; static char __pyx_k__join[] = "join"; static char __pyx_k__keys[] = "keys"; static char __pyx_k__name[] = "name"; static char __pyx_k__next[] = "next"; static char __pyx_k__prev[] = "prev"; static char __pyx_k__rule[] = "rule"; static char __pyx_k__self[] = "self"; static char __pyx_k__step[] = "step"; static char __pyx_k__text[] = "text"; static char __pyx_k__type[] = "type"; static char __pyx_k__Token[] = "Token"; static char __pyx_k__WHITE[] = "WHITE"; static char __pyx_k___tree[] = "_tree"; static char __pyx_k___type[] = "_type"; static char __pyx_k__attrs[] = "attrs"; static char __pyx_k__cache[] = "cache"; static char __pyx_k__chars[] = "chars"; static char __pyx_k__check[] = "check"; static char __pyx_k__child[] = "child"; static char __pyx_k__index[] = "index"; static char __pyx_k__items[] = "items"; static char __pyx_k__rules[] = "rules"; static char __pyx_k__start[] = "start"; static char __pyx_k__token[] = "token"; static char __pyx_k__types[] = "types"; static char __pyx_k__value[] = "value"; static char __pyx_k__which[] = "which"; static char __pyx_k__CToken[] = "CToken"; static char __pyx_k__DEDENT[] = "DEDENT"; static char __pyx_k__INDENT[] = "INDENT"; static char __pyx_k__NUMBER[] = "NUMBER"; static char __pyx_k__STRING[] = "STRING"; static char __pyx_k__append[] = "append"; static char __pyx_k__charno[] = "charno"; static char __pyx_k__ignore[] = "ignore"; static char __pyx_k__indent[] = "indent"; static char __pyx_k__insert[] = "insert"; static char __pyx_k__lineno[] = "lineno"; static char __pyx_k__object[] = "object"; static char __pyx_k__option[] = "option"; static char __pyx_k__parent[] = "parent"; static char __pyx_k__reason[] = "reason"; static char __pyx_k__single[] = "single"; static char __pyx_k__tokens[] = "tokens"; static char __pyx_k__wanted[] = "wanted"; static char __pyx_k__ANYCHAR[] = "ANYCHAR"; static char __pyx_k__IdToken[] = "IdToken"; static char __pyx_k__NEWLINE[] = "NEWLINE"; static char __pyx_k__PyToken[] = "PyToken"; static char __pyx_k__ReToken[] = "ReToken"; static char __pyx_k__SSTRING[] = "SSTRING"; static char __pyx_k__TSTRING[] = "TSTRING"; static char __pyx_k____str__[] = "__str__"; static char __pyx_k__getattr[] = "getattr"; static char __pyx_k__idchars[] = "idchars"; static char __pyx_k__indents[] = "indents"; static char __pyx_k__options[] = "options"; static char __pyx_k__prepend[] = "prepend"; static char __pyx_k__special[] = "special"; static char __pyx_k__start_i[] = "start_i"; static char __pyx_k__strings[] = "strings"; static char __pyx_k__AstError[] = "AstError"; static char __pyx_k__CCOMMENT[] = "CCOMMENT"; static char __pyx_k__IIdToken[] = "IIdToken"; static char __pyx_k____init__[] = "__init__"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____name__[] = "__name__"; static char __pyx_k____repr__[] = "__repr__"; static char __pyx_k____test__[] = "__test__"; static char __pyx_k___str_cid[] = "_str_cid"; static char __pyx_k__children[] = "children"; static char __pyx_k__numtypes[] = "numtypes"; static char __pyx_k__CMCOMMENT[] = "CMCOMMENT"; static char __pyx_k__CharToken[] = "CharToken"; static char __pyx_k__Exception[] = "Exception"; static char __pyx_k__PYCOMMENT[] = "PYCOMMENT"; static char __pyx_k__ParseNode[] = "ParseNode"; static char __pyx_k__ast_attrs[] = "ast_attrs"; static char __pyx_k__keep_tree[] = "keep_tree"; static char __pyx_k__ParseError[] = "ParseError"; static char __pyx_k__TokenError[] = "TokenError"; static char __pyx_k__ast_tokens[] = "ast_tokens"; static char __pyx_k__rule_funcs[] = "rule_funcs"; static char __pyx_k__rule_names[] = "rule_names"; static char __pyx_k__StringToken[] = "StringToken"; static char __pyx_k__ast_classes[] = "ast_classes"; static char __pyx_k__dont_ignore[] = "dont_ignore"; static char __pyx_k__max_indents[] = "max_indents"; static char __pyx_k__num_indents[] = "num_indents"; static char __pyx_k__pass_single[] = "pass_single"; static char __pyx_k__python_data[] = "python_data"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_s_11; static PyObject *__pyx_kp_s_12; static PyObject *__pyx_kp_s_13; static PyObject *__pyx_kp_s_14; static PyObject *__pyx_kp_s_15; static PyObject *__pyx_kp_s_16; static PyObject *__pyx_kp_u_17; static PyObject *__pyx_kp_s_18; static PyObject *__pyx_kp_s_20; static PyObject *__pyx_n_s_21; static PyObject *__pyx_n_s_22; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_kp_s_4; static PyObject *__pyx_kp_s_5; static PyObject *__pyx_kp_s_6; static PyObject *__pyx_kp_s_7; static PyObject *__pyx_kp_s_8; static PyObject *__pyx_kp_s_9; static PyObject *__pyx_n_s__ANY; static PyObject *__pyx_n_s__ANYCHAR; static PyObject *__pyx_n_s__AstError; static PyObject *__pyx_n_s__CCOMMENT; static PyObject *__pyx_n_s__CMCOMMENT; static PyObject *__pyx_n_s__CToken; static PyObject *__pyx_n_s__CharToken; static PyObject *__pyx_n_s__DEDENT; static PyObject *__pyx_n_s__EOF; static PyObject *__pyx_n_s__Exception; static PyObject *__pyx_n_s__HEX; static PyObject *__pyx_n_s__ID; static PyObject *__pyx_n_s__IIdToken; static PyObject *__pyx_n_s__INDENT; static PyObject *__pyx_n_s__INT; static PyObject *__pyx_n_s__IdToken; static PyObject *__pyx_n_s__NEWLINE; static PyObject *__pyx_n_s__NUMBER; static PyObject *__pyx_n_s__PYCOMMENT; static PyObject *__pyx_n_s__ParseError; static PyObject *__pyx_n_s__ParseNode; static PyObject *__pyx_n_s__PyToken; static PyObject *__pyx_n_s__ReToken; static PyObject *__pyx_n_s__SSTRING; static PyObject *__pyx_n_s__STRING; static PyObject *__pyx_n_s__StringToken; static PyObject *__pyx_n_s__TSTRING; static PyObject *__pyx_n_s__Token; static PyObject *__pyx_n_s__TokenError; static PyObject *__pyx_n_s__WHITE; static PyObject *__pyx_n_s____init__; static PyObject *__pyx_n_s____main__; static PyObject *__pyx_n_s____name__; static PyObject *__pyx_n_s____repr__; static PyObject *__pyx_n_s____str__; static PyObject *__pyx_n_s____test__; static PyObject *__pyx_n_s___str_cid; static PyObject *__pyx_n_s___tree; static PyObject *__pyx_n_s___type; static PyObject *__pyx_n_s__append; static PyObject *__pyx_n_s__ast_attrs; static PyObject *__pyx_n_s__ast_classes; static PyObject *__pyx_n_s__ast_tokens; static PyObject *__pyx_n_s__at; static PyObject *__pyx_n_s__attrs; static PyObject *__pyx_n_s__cache; static PyObject *__pyx_n_s__charno; static PyObject *__pyx_n_s__chars; static PyObject *__pyx_n_s__check; static PyObject *__pyx_n_s__child; static PyObject *__pyx_n_s__children; static PyObject *__pyx_n_s__dont_ignore; static PyObject *__pyx_n_s__end; static PyObject *__pyx_n_s__eof; static PyObject *__pyx_n_s__get; static PyObject *__pyx_n_s__getattr; static PyObject *__pyx_n_s__gid; static PyObject *__pyx_n_s__i; static PyObject *__pyx_n_s__idchars; static PyObject *__pyx_n_s__ignore; static PyObject *__pyx_n_s__indent; static PyObject *__pyx_n_s__indents; static PyObject *__pyx_n_s__index; static PyObject *__pyx_n_s__insert; static PyObject *__pyx_n_s__items; static PyObject *__pyx_n_s__join; static PyObject *__pyx_n_s__keep_tree; static PyObject *__pyx_n_s__keys; static PyObject *__pyx_n_s__lineno; static PyObject *__pyx_n_s__ln; static PyObject *__pyx_n_s__max_indents; static PyObject *__pyx_n_s__name; static PyObject *__pyx_n_s__next; static PyObject *__pyx_n_s__num; static PyObject *__pyx_n_s__num_indents; static PyObject *__pyx_n_s__numtypes; static PyObject *__pyx_n_s__object; static PyObject *__pyx_n_s__option; static PyObject *__pyx_n_s__options; static PyObject *__pyx_n_s__parent; static PyObject *__pyx_n_s__pass_single; static PyObject *__pyx_n_s__prepend; static PyObject *__pyx_n_s__prev; static PyObject *__pyx_n_s__python_data; static PyObject *__pyx_n_s__reason; static PyObject *__pyx_n_s__rule; static PyObject *__pyx_n_s__rule_funcs; static PyObject *__pyx_n_s__rule_names; static PyObject *__pyx_n_s__rules; static PyObject *__pyx_n_s__self; static PyObject *__pyx_n_s__single; static PyObject *__pyx_n_s__special; static PyObject *__pyx_n_s__start; static PyObject *__pyx_n_s__start_i; static PyObject *__pyx_n_s__step; static PyObject *__pyx_n_s__strings; static PyObject *__pyx_n_s__text; static PyObject *__pyx_n_s__tid; static PyObject *__pyx_n_s__token; static PyObject *__pyx_n_s__tokens; static PyObject *__pyx_n_s__type; static PyObject *__pyx_n_s__types; static PyObject *__pyx_n_s__value; static PyObject *__pyx_n_s__wanted; static PyObject *__pyx_n_s__which; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_k_10; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":46 * int toupper(char what) * * cdef inline int strichr(char* dest, char needle): # <<<<<<<<<<<<<< * return strchr(dest, tolower(needle))!=NULL or strchr(dest, toupper(needle))!=NULL * */ static CYTHON_INLINE int __pyx_f_10codetalker_8cgrammar_strichr(char *__pyx_v_dest, char __pyx_v_needle) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("strichr"); __Pyx_TraceCall("strichr", __pyx_f[0], 46); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":47 * * cdef inline int strichr(char* dest, char needle): * return strchr(dest, tolower(needle))!=NULL or strchr(dest, toupper(needle))!=NULL # <<<<<<<<<<<<<< * * */ __pyx_t_1 = (strchr(__pyx_v_dest, tolower(__pyx_v_needle)) != NULL); if (!__pyx_t_1) { __pyx_t_2 = (strchr(__pyx_v_dest, toupper(__pyx_v_needle)) != NULL); __pyx_t_3 = __pyx_t_2; } else { __pyx_t_3 = __pyx_t_1; } __pyx_r = __pyx_t_3; goto __pyx_L0; __pyx_r = 0; __pyx_L0:; __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":257 * python_data = {} * * def consume_grammar(rules, ignore, indent, idchars, rule_names, rule_funcs, tokens, ast_attrs): # <<<<<<<<<<<<<< * cdef Grammar grammar * grammar.rules = convert_rules(rules) */ static PyObject *__pyx_pf_10codetalker_8cgrammar_consume_grammar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pf_10codetalker_8cgrammar_consume_grammar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rules = 0; PyObject *__pyx_v_ignore = 0; PyObject *__pyx_v_indent = 0; PyObject *__pyx_v_idchars = 0; PyObject *__pyx_v_rule_names = 0; PyObject *__pyx_v_rule_funcs = 0; PyObject *__pyx_v_tokens = 0; PyObject *__pyx_v_ast_attrs = 0; struct Grammar __pyx_v_grammar; int __pyx_v_gid; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__rules,&__pyx_n_s__ignore,&__pyx_n_s__indent,&__pyx_n_s__idchars,&__pyx_n_s__rule_names,&__pyx_n_s__rule_funcs,&__pyx_n_s__tokens,&__pyx_n_s__ast_attrs,0}; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("consume_grammar"); __Pyx_TraceCall("consume_grammar", __pyx_f[0], 257); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[8] = {0,0,0,0,0,0,0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rules); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ignore); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__indent); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__idchars); if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rule_names); if (likely(values[4])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rule_funcs); if (likely(values[5])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tokens); if (likely(values[6])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ast_attrs); if (likely(values[7])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "consume_grammar") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_rules = values[0]; __pyx_v_ignore = values[1]; __pyx_v_indent = values[2]; __pyx_v_idchars = values[3]; __pyx_v_rule_names = values[4]; __pyx_v_rule_funcs = values[5]; __pyx_v_tokens = values[6]; __pyx_v_ast_attrs = values[7]; } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { __pyx_v_rules = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_ignore = PyTuple_GET_ITEM(__pyx_args, 1); __pyx_v_indent = PyTuple_GET_ITEM(__pyx_args, 2); __pyx_v_idchars = PyTuple_GET_ITEM(__pyx_args, 3); __pyx_v_rule_names = PyTuple_GET_ITEM(__pyx_args, 4); __pyx_v_rule_funcs = PyTuple_GET_ITEM(__pyx_args, 5); __pyx_v_tokens = PyTuple_GET_ITEM(__pyx_args, 6); __pyx_v_ast_attrs = PyTuple_GET_ITEM(__pyx_args, 7); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("consume_grammar", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("codetalker.cgrammar.consume_grammar"); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":259 * def consume_grammar(rules, ignore, indent, idchars, rule_names, rule_funcs, tokens, ast_attrs): * cdef Grammar grammar * grammar.rules = convert_rules(rules) # <<<<<<<<<<<<<< * grammar.ignore = convert_ignore(ignore, tokens) * convert_ast_attrs(ast_attrs, rule_funcs, tokens, &grammar.ast_attrs) */ __pyx_v_grammar.rules = __pyx_f_10codetalker_8cgrammar_convert_rules(__pyx_v_rules); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":260 * cdef Grammar grammar * grammar.rules = convert_rules(rules) * grammar.ignore = convert_ignore(ignore, tokens) # <<<<<<<<<<<<<< * convert_ast_attrs(ast_attrs, rule_funcs, tokens, &grammar.ast_attrs) * grammar.tokens = convert_ptokens(tokens) */ __pyx_v_grammar.ignore = __pyx_f_10codetalker_8cgrammar_convert_ignore(__pyx_v_ignore, __pyx_v_tokens); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":261 * grammar.rules = convert_rules(rules) * grammar.ignore = convert_ignore(ignore, tokens) * convert_ast_attrs(ast_attrs, rule_funcs, tokens, &grammar.ast_attrs) # <<<<<<<<<<<<<< * grammar.tokens = convert_ptokens(tokens) * grammar.idchars = idchars */ __pyx_t_1 = __pyx_f_10codetalker_8cgrammar_convert_ast_attrs(__pyx_v_ast_attrs, __pyx_v_rule_funcs, __pyx_v_tokens, (&__pyx_v_grammar.ast_attrs)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":262 * grammar.ignore = convert_ignore(ignore, tokens) * convert_ast_attrs(ast_attrs, rule_funcs, tokens, &grammar.ast_attrs) * grammar.tokens = convert_ptokens(tokens) # <<<<<<<<<<<<<< * grammar.idchars = idchars * cdef int gid = store_grammar(grammar) */ __pyx_v_grammar.tokens = __pyx_f_10codetalker_8cgrammar_convert_ptokens(__pyx_v_tokens); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":263 * convert_ast_attrs(ast_attrs, rule_funcs, tokens, &grammar.ast_attrs) * grammar.tokens = convert_ptokens(tokens) * grammar.idchars = idchars # <<<<<<<<<<<<<< * cdef int gid = store_grammar(grammar) * python_data[gid] = rule_names, tokens, indent */ __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_idchars); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_grammar.idchars = __pyx_t_2; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":264 * grammar.tokens = convert_ptokens(tokens) * grammar.idchars = idchars * cdef int gid = store_grammar(grammar) # <<<<<<<<<<<<<< * python_data[gid] = rule_names, tokens, indent * return gid */ __pyx_v_gid = store_grammar(__pyx_v_grammar); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":265 * grammar.idchars = idchars * cdef int gid = store_grammar(grammar) * python_data[gid] = rule_names, tokens, indent # <<<<<<<<<<<<<< * return gid * */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_rule_names); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rule_names); __Pyx_GIVEREF(__pyx_v_rule_names); __Pyx_INCREF(__pyx_v_tokens); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tokens); __Pyx_GIVEREF(__pyx_v_tokens); __Pyx_INCREF(__pyx_v_indent); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_indent); __Pyx_GIVEREF(__pyx_v_indent); __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemInt(__pyx_t_3, __pyx_v_gid, __pyx_t_1, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":266 * cdef int gid = store_grammar(grammar) * python_data[gid] = rule_names, tokens, indent * return gid # <<<<<<<<<<<<<< * * def get_tokens(gid, text): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(__pyx_v_gid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("codetalker.cgrammar.consume_grammar"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":268 * return gid * * def get_tokens(gid, text): # <<<<<<<<<<<<<< * cdef Token* tokens * */ static PyObject *__pyx_pf_10codetalker_8cgrammar_get_tokens(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pf_10codetalker_8cgrammar_get_tokens(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_gid = 0; PyObject *__pyx_v_text = 0; struct Token *__pyx_v_tokens; PyObject *__pyx_v_pytokens; PyObject *__pyx_r = NULL; int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gid,&__pyx_n_s__text,0}; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("get_tokens"); __Pyx_TraceCall("get_tokens", __pyx_f[0], 268); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gid); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__text); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_tokens", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_tokens") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_gid = values[0]; __pyx_v_text = values[1]; } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_gid = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_tokens", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("codetalker.cgrammar.get_tokens"); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_v_pytokens = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":271 * cdef Token* tokens * * try_get_tokens(gid, text, &tokens) # <<<<<<<<<<<<<< * * pytokens = convert_back_tokens(gid, tokens) */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar_try_get_tokens(__pyx_t_1, __pyx_t_2, (&__pyx_v_tokens)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":273 * try_get_tokens(gid, text, &tokens) * * pytokens = convert_back_tokens(gid, tokens) # <<<<<<<<<<<<<< * kill_tokens(tokens) * return pytokens */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar_convert_back_tokens(__pyx_t_1, __pyx_v_tokens); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_pytokens); __pyx_v_pytokens = __pyx_t_3; __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":274 * * pytokens = convert_back_tokens(gid, tokens) * kill_tokens(tokens) # <<<<<<<<<<<<<< * return pytokens * */ __pyx_f_10codetalker_8cgrammar_kill_tokens(__pyx_v_tokens); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":275 * pytokens = convert_back_tokens(gid, tokens) * kill_tokens(tokens) * return pytokens # <<<<<<<<<<<<<< * * cdef object try_get_tokens(int gid, char* text, Token** tokens): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pytokens); __pyx_r = __pyx_v_pytokens; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("codetalker.cgrammar.get_tokens"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_pytokens); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":277 * return pytokens * * cdef object try_get_tokens(int gid, char* text, Token** tokens): # <<<<<<<<<<<<<< * cdef cTokenError error * error.text = '' */ static PyObject *__pyx_f_10codetalker_8cgrammar_try_get_tokens(int __pyx_v_gid, char *__pyx_v_text, struct Token **__pyx_v_tokens) { struct cTokenError __pyx_v_error; struct Grammar *__pyx_v_grammar; PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("try_get_tokens"); __Pyx_TraceCall("try_get_tokens", __pyx_f[0], 277); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":279 * cdef object try_get_tokens(int gid, char* text, Token** tokens): * cdef cTokenError error * error.text = '' # <<<<<<<<<<<<<< * cdef Grammar* grammar = load_grammar(gid) * if grammar.tokens.num != -1: */ __pyx_v_error.text = __pyx_k_1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":280 * cdef cTokenError error * error.text = '' * cdef Grammar* grammar = load_grammar(gid) # <<<<<<<<<<<<<< * if grammar.tokens.num != -1: * tokens[0] = c_get_tokens(grammar, text, python_data[gid][2], &error) */ __pyx_v_grammar = load_grammar(__pyx_v_gid); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":281 * error.text = '' * cdef Grammar* grammar = load_grammar(gid) * if grammar.tokens.num != -1: # <<<<<<<<<<<<<< * tokens[0] = c_get_tokens(grammar, text, python_data[gid][2], &error) * else: */ __pyx_t_1 = (__pyx_v_grammar->tokens.num != -1); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":282 * cdef Grammar* grammar = load_grammar(gid) * if grammar.tokens.num != -1: * tokens[0] = c_get_tokens(grammar, text, python_data[gid][2], &error) # <<<<<<<<<<<<<< * else: * tokens[0] = _get_tokens(gid, text, &error, grammar.idchars) */ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_tokens[0]) = c_get_tokens(__pyx_v_grammar, __pyx_v_text, __pyx_t_4, (&__pyx_v_error)); goto __pyx_L3; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":284 * tokens[0] = c_get_tokens(grammar, text, python_data[gid][2], &error) * else: * tokens[0] = _get_tokens(gid, text, &error, grammar.idchars) # <<<<<<<<<<<<<< * * if tokens[0] == NULL: */ (__pyx_v_tokens[0]) = __pyx_f_10codetalker_8cgrammar__get_tokens(__pyx_v_gid, __pyx_v_text, (&__pyx_v_error), __pyx_v_grammar->idchars); } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":286 * tokens[0] = _get_tokens(gid, text, &error, grammar.idchars) * * if tokens[0] == NULL: # <<<<<<<<<<<<<< * if len(error.text): * raise TokenError(error.text, text, error.lineno, error.charno) */ __pyx_t_1 = ((__pyx_v_tokens[0]) == NULL); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":287 * * if tokens[0] == NULL: * if len(error.text): # <<<<<<<<<<<<<< * raise TokenError(error.text, text, error.lineno, error.charno) * */ __pyx_t_5 = strlen(__pyx_v_error.text); if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":288 * if tokens[0] == NULL: * if len(error.text): * raise TokenError(error.text, text, error.lineno, error.charno) # <<<<<<<<<<<<<< * * def get_parse_tree(gid, text, start_i): */ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__TokenError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_error.text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_text); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __pyx_t_7 = PyInt_FromLong(__pyx_v_error.lineno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyInt_FromLong(__pyx_v_error.charno); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_t_6)); __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; goto __pyx_L4; } __pyx_L4:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("codetalker.cgrammar.try_get_tokens"); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":290 * raise TokenError(error.text, text, error.lineno, error.charno) * * def get_parse_tree(gid, text, start_i): # <<<<<<<<<<<<<< * cdef Token* tokens * */ static PyObject *__pyx_pf_10codetalker_8cgrammar_get_parse_tree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pf_10codetalker_8cgrammar_get_parse_tree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_gid = 0; PyObject *__pyx_v_text = 0; PyObject *__pyx_v_start_i = 0; struct Token *__pyx_v_tokens; struct TokenStream __pyx_v_tstream; struct cParseNode *__pyx_v_ptree; PyObject *__pyx_v_pyptree; PyObject *__pyx_r = NULL; int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gid,&__pyx_n_s__text,&__pyx_n_s__start_i,0}; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("get_parse_tree"); __Pyx_TraceCall("get_parse_tree", __pyx_f[0], 290); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gid); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__text); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_parse_tree", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_i); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_parse_tree", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_parse_tree") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_gid = values[0]; __pyx_v_text = values[1]; __pyx_v_start_i = values[2]; } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { __pyx_v_gid = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 1); __pyx_v_start_i = PyTuple_GET_ITEM(__pyx_args, 2); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_parse_tree", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("codetalker.cgrammar.get_parse_tree"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_gid); __Pyx_INCREF(__pyx_v_text); __Pyx_INCREF(__pyx_v_start_i); __pyx_v_pyptree = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":293 * cdef Token* tokens * * try_get_tokens(gid, text, &tokens) # <<<<<<<<<<<<<< * * cdef TokenStream tstream = tokens_to_stream(tokens) */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar_try_get_tokens(__pyx_t_1, __pyx_t_2, (&__pyx_v_tokens)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":295 * try_get_tokens(gid, text, &tokens) * * cdef TokenStream tstream = tokens_to_stream(tokens) # <<<<<<<<<<<<<< * tstream.eof = python_data[gid][1].index(EOF) * */ __pyx_v_tstream = __pyx_f_10codetalker_8cgrammar_tokens_to_stream(__pyx_v_tokens); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":296 * * cdef TokenStream tstream = tokens_to_stream(tokens) * tstream.eof = python_data[gid][1].index(EOF) # <<<<<<<<<<<<<< * * cdef cParseNode* ptree */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_gid); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__EOF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tstream.eof = __pyx_t_6; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":299 * * cdef cParseNode* ptree * try_get_parse_tree(gid, text, start_i, &tstream, &ptree) # <<<<<<<<<<<<<< * if ptree == NULL: * return None */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_start_i); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar_try_get_parse_tree(__pyx_t_1, __pyx_t_2, __pyx_t_7, (&__pyx_v_tstream), (&__pyx_v_ptree)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":300 * cdef cParseNode* ptree * try_get_parse_tree(gid, text, start_i, &tstream, &ptree) * if ptree == NULL: # <<<<<<<<<<<<<< * return None * pyptree = convert_back_ptree(gid, ptree) */ __pyx_t_8 = (__pyx_v_ptree == NULL); if (__pyx_t_8) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":301 * try_get_parse_tree(gid, text, start_i, &tstream, &ptree) * if ptree == NULL: * return None # <<<<<<<<<<<<<< * pyptree = convert_back_ptree(gid, ptree) * kill_ptree(ptree) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L6; } __pyx_L6:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":302 * if ptree == NULL: * return None * pyptree = convert_back_ptree(gid, ptree) # <<<<<<<<<<<<<< * kill_ptree(ptree) * kill_tokens(tokens) */ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar_convert_back_ptree(__pyx_t_7, __pyx_v_ptree); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_pyptree); __pyx_v_pyptree = __pyx_t_3; __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":303 * return None * pyptree = convert_back_ptree(gid, ptree) * kill_ptree(ptree) # <<<<<<<<<<<<<< * kill_tokens(tokens) * return pyptree */ __pyx_f_10codetalker_8cgrammar_kill_ptree(__pyx_v_ptree); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":304 * pyptree = convert_back_ptree(gid, ptree) * kill_ptree(ptree) * kill_tokens(tokens) # <<<<<<<<<<<<<< * return pyptree * */ __pyx_f_10codetalker_8cgrammar_kill_tokens(__pyx_v_tokens); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":305 * kill_ptree(ptree) * kill_tokens(tokens) * return pyptree # <<<<<<<<<<<<<< * * cdef object try_get_parse_tree(int gid, char* text, int start, TokenStream* tstream, cParseNode** ptree): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyptree); __pyx_r = __pyx_v_pyptree; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("codetalker.cgrammar.get_parse_tree"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_pyptree); __Pyx_DECREF(__pyx_v_gid); __Pyx_DECREF(__pyx_v_text); __Pyx_DECREF(__pyx_v_start_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":307 * return pyptree * * cdef object try_get_parse_tree(int gid, char* text, int start, TokenStream* tstream, cParseNode** ptree): # <<<<<<<<<<<<<< * cdef Grammar* grammar = load_grammar(gid) * cdef Error error */ static PyObject *__pyx_f_10codetalker_8cgrammar_try_get_parse_tree(int __pyx_v_gid, char *__pyx_v_text, int __pyx_v_start, struct TokenStream *__pyx_v_tstream, struct cParseNode **__pyx_v_ptree) { struct Grammar *__pyx_v_grammar; struct Error __pyx_v_error; PyObject *__pyx_v_txt; PyObject *__pyx_r = NULL; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("try_get_parse_tree"); __Pyx_TraceCall("try_get_parse_tree", __pyx_f[0], 307); __pyx_v_txt = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":308 * * cdef object try_get_parse_tree(int gid, char* text, int start, TokenStream* tstream, cParseNode** ptree): * cdef Grammar* grammar = load_grammar(gid) # <<<<<<<<<<<<<< * cdef Error error * error.reason = -1 */ __pyx_v_grammar = load_grammar(__pyx_v_gid); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":310 * cdef Grammar* grammar = load_grammar(gid) * cdef Error error * error.reason = -1 # <<<<<<<<<<<<<< * error.text = '(no error)' * error.at = 0 */ __pyx_v_error.reason = -1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":311 * cdef Error error * error.reason = -1 * error.text = '(no error)' # <<<<<<<<<<<<<< * error.at = 0 * ptree[0] = _get_parse_tree(start, grammar, tstream, &error) */ __pyx_v_error.text = __pyx_k_2; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":312 * error.reason = -1 * error.text = '(no error)' * error.at = 0 # <<<<<<<<<<<<<< * ptree[0] = _get_parse_tree(start, grammar, tstream, &error) * if tstream.at < tstream.num or (not tstream.num and error.reason != -1): */ __pyx_v_error.at = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":313 * error.text = '(no error)' * error.at = 0 * ptree[0] = _get_parse_tree(start, grammar, tstream, &error) # <<<<<<<<<<<<<< * if tstream.at < tstream.num or (not tstream.num and error.reason != -1): * if error.reason == 1: */ (__pyx_v_ptree[0]) = _get_parse_tree(__pyx_v_start, __pyx_v_grammar, __pyx_v_tstream, (&__pyx_v_error)); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":314 * error.at = 0 * ptree[0] = _get_parse_tree(start, grammar, tstream, &error) * if tstream.at < tstream.num or (not tstream.num and error.reason != -1): # <<<<<<<<<<<<<< * if error.reason == 1: * txt = "Ran out of tokens (expected %s)" % python_data[gid][1][error.wanted].__name__ */ __pyx_t_1 = (__pyx_v_tstream->at < __pyx_v_tstream->num); if (!__pyx_t_1) { __pyx_t_2 = (!__pyx_v_tstream->num); if (__pyx_t_2) { __pyx_t_3 = (__pyx_v_error.reason != -1); __pyx_t_4 = __pyx_t_3; } else { __pyx_t_4 = __pyx_t_2; } __pyx_t_2 = __pyx_t_4; } else { __pyx_t_2 = __pyx_t_1; } if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":315 * ptree[0] = _get_parse_tree(start, grammar, tstream, &error) * if tstream.at < tstream.num or (not tstream.num and error.reason != -1): * if error.reason == 1: # <<<<<<<<<<<<<< * txt = "Ran out of tokens (expected %s)" % python_data[gid][1][error.wanted].__name__ * error.token = get_last_token(tstream) */ switch (__pyx_v_error.reason) { case 1: /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":316 * if tstream.at < tstream.num or (not tstream.num and error.reason != -1): * if error.reason == 1: * txt = "Ran out of tokens (expected %s)" % python_data[gid][1][error.wanted].__name__ # <<<<<<<<<<<<<< * error.token = get_last_token(tstream) * elif error.reason == 4: */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_error.wanted, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s____name__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = __pyx_t_6; __pyx_t_6 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":317 * if error.reason == 1: * txt = "Ran out of tokens (expected %s)" % python_data[gid][1][error.wanted].__name__ * error.token = get_last_token(tstream) # <<<<<<<<<<<<<< * elif error.reason == 4: * txt = "just ran out of tokens... (expected '%s')" % error.text */ __pyx_v_error.token = __pyx_f_10codetalker_8cgrammar_get_last_token(__pyx_v_tstream); break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":318 * txt = "Ran out of tokens (expected %s)" % python_data[gid][1][error.wanted].__name__ * error.token = get_last_token(tstream) * elif error.reason == 4: # <<<<<<<<<<<<<< * txt = "just ran out of tokens... (expected '%s')" % error.text * error.token = get_last_token(tstream) */ case 4: /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":319 * error.token = get_last_token(tstream) * elif error.reason == 4: * txt = "just ran out of tokens... (expected '%s')" % error.text # <<<<<<<<<<<<<< * error.token = get_last_token(tstream) * else: */ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_error.text); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = __pyx_t_5; __pyx_t_5 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":320 * elif error.reason == 4: * txt = "just ran out of tokens... (expected '%s')" % error.text * error.token = get_last_token(tstream) # <<<<<<<<<<<<<< * else: * txt = format_parse_error(gid, tstream, &error) */ __pyx_v_error.token = __pyx_f_10codetalker_8cgrammar_get_last_token(__pyx_v_tstream); break; default: /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":322 * error.token = get_last_token(tstream) * else: * txt = format_parse_error(gid, tstream, &error) # <<<<<<<<<<<<<< * # print "Didn't use all the tokens (%d out of %d)" % (tstream.at, tstream.num) * raise ParseError(txt, error.token.lineno, error.token.charno) */ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_f_10codetalker_8cgrammar_format_parse_error(__pyx_v_gid, __pyx_v_tstream, (&__pyx_v_error))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = ((PyObject *)__pyx_t_5); __pyx_t_5 = 0; break; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":324 * txt = format_parse_error(gid, tstream, &error) * # print "Didn't use all the tokens (%d out of %d)" % (tstream.at, tstream.num) * raise ParseError(txt, error.token.lineno, error.token.charno) # <<<<<<<<<<<<<< * * cdef char* format_parse_error(int gid, TokenStream* tstream, Error* error): */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__ParseError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_error.token->lineno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyLong_FromUnsignedLong(__pyx_v_error.token->charno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_txt); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_txt); __Pyx_GIVEREF(__pyx_v_txt); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("codetalker.cgrammar.try_get_parse_tree"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_txt); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":326 * raise ParseError(txt, error.token.lineno, error.token.charno) * * cdef char* format_parse_error(int gid, TokenStream* tstream, Error* error): # <<<<<<<<<<<<<< * txt = 'Unknown Error' * rule_names, tokens, indent = python_data[gid] */ static char *__pyx_f_10codetalker_8cgrammar_format_parse_error(int __pyx_v_gid, struct TokenStream *__pyx_v_tstream, struct Error *__pyx_v_error) { PyObject *__pyx_v_txt; PyObject *__pyx_v_rule_names; PyObject *__pyx_v_tokens; PyObject *__pyx_v_indent; char *__pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char *__pyx_t_7; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("format_parse_error"); __Pyx_TraceCall("format_parse_error", __pyx_f[0], 326); __pyx_v_txt = Py_None; __Pyx_INCREF(Py_None); __pyx_v_rule_names = Py_None; __Pyx_INCREF(Py_None); __pyx_v_tokens = Py_None; __Pyx_INCREF(Py_None); __pyx_v_indent = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":327 * * cdef char* format_parse_error(int gid, TokenStream* tstream, Error* error): * txt = 'Unknown Error' # <<<<<<<<<<<<<< * rule_names, tokens, indent = python_data[gid] * if tstream.at > error.at: */ __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = ((PyObject *)__pyx_kp_s_5); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":328 * cdef char* format_parse_error(int gid, TokenStream* tstream, Error* error): * txt = 'Unknown Error' * rule_names, tokens, indent = python_data[gid] # <<<<<<<<<<<<<< * if tstream.at > error.at: * txt = "Extra data (expected EOF)" */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 3)) { PyObject* tuple = __pyx_t_2; __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_rule_names); __pyx_v_rule_names = __pyx_t_1; __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_tokens); __pyx_v_tokens = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_indent); __pyx_v_indent = __pyx_t_4; __pyx_t_4 = 0; } else { __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_rule_names); __pyx_v_rule_names = __pyx_t_1; __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_tokens); __pyx_v_tokens = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_indent); __pyx_v_indent = __pyx_t_4; __pyx_t_4 = 0; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":329 * txt = 'Unknown Error' * rule_names, tokens, indent = python_data[gid] * if tstream.at > error.at: # <<<<<<<<<<<<<< * txt = "Extra data (expected EOF)" * error.token = &tstream.tokens[tstream.at] */ __pyx_t_6 = (__pyx_v_tstream->at > __pyx_v_error->at); if (__pyx_t_6) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":330 * rule_names, tokens, indent = python_data[gid] * if tstream.at > error.at: * txt = "Extra data (expected EOF)" # <<<<<<<<<<<<<< * error.token = &tstream.tokens[tstream.at] * elif error.reason == 1: */ __Pyx_INCREF(((PyObject *)__pyx_kp_s_6)); __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = ((PyObject *)__pyx_kp_s_6); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":331 * if tstream.at > error.at: * txt = "Extra data (expected EOF)" * error.token = &tstream.tokens[tstream.at] # <<<<<<<<<<<<<< * elif error.reason == 1: * txt = "Ran out of tokens (expected %s)" % tokens[error.wanted] */ __pyx_v_error->token = (&(__pyx_v_tstream->tokens[__pyx_v_tstream->at])); goto __pyx_L3; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":332 * txt = "Extra data (expected EOF)" * error.token = &tstream.tokens[tstream.at] * elif error.reason == 1: # <<<<<<<<<<<<<< * txt = "Ran out of tokens (expected %s)" % tokens[error.wanted] * elif error.reason == 2: */ __pyx_t_6 = (__pyx_v_error->reason == 1); if (__pyx_t_6) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":333 * error.token = &tstream.tokens[tstream.at] * elif error.reason == 1: * txt = "Ran out of tokens (expected %s)" % tokens[error.wanted] # <<<<<<<<<<<<<< * elif error.reason == 2: * txt = "Failed while parsing rule '%s' (don't know what to do with '%s' <%s>)" % (rule_names[error.wanted], error.token.value, tokens[error.token.which].__name__) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_tokens, __pyx_v_error->wanted, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":334 * elif error.reason == 1: * txt = "Ran out of tokens (expected %s)" % tokens[error.wanted] * elif error.reason == 2: # <<<<<<<<<<<<<< * txt = "Failed while parsing rule '%s' (don't know what to do with '%s' <%s>)" % (rule_names[error.wanted], error.token.value, tokens[error.token.which].__name__) * elif error.reason == 3: */ __pyx_t_6 = (__pyx_v_error->reason == 2); if (__pyx_t_6) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":335 * txt = "Ran out of tokens (expected %s)" % tokens[error.wanted] * elif error.reason == 2: * txt = "Failed while parsing rule '%s' (don't know what to do with '%s' <%s>)" % (rule_names[error.wanted], error.token.value, tokens[error.token.which].__name__) # <<<<<<<<<<<<<< * elif error.reason == 3: * txt = "Invalid token %s <%s> (expected <%s>)" % (error.token.value, */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rule_names, __pyx_v_error->wanted, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_error->token->value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_tokens, __pyx_v_error->token->which, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L3; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":336 * elif error.reason == 2: * txt = "Failed while parsing rule '%s' (don't know what to do with '%s' <%s>)" % (rule_names[error.wanted], error.token.value, tokens[error.token.which].__name__) * elif error.reason == 3: # <<<<<<<<<<<<<< * txt = "Invalid token %s <%s> (expected <%s>)" % (error.token.value, * tokens[error.token.which].__name__, tokens[error.wanted].__name__) */ __pyx_t_6 = (__pyx_v_error->reason == 3); if (__pyx_t_6) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":337 * txt = "Failed while parsing rule '%s' (don't know what to do with '%s' <%s>)" % (rule_names[error.wanted], error.token.value, tokens[error.token.which].__name__) * elif error.reason == 3: * txt = "Invalid token %s <%s> (expected <%s>)" % (error.token.value, # <<<<<<<<<<<<<< * tokens[error.token.which].__name__, tokens[error.wanted].__name__) * elif error.reason == 4: */ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_error->token->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":338 * elif error.reason == 3: * txt = "Invalid token %s <%s> (expected <%s>)" % (error.token.value, * tokens[error.token.which].__name__, tokens[error.wanted].__name__) # <<<<<<<<<<<<<< * elif error.reason == 4: * txt = "just ran out of tokens... (expected '%s')" % error.text */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_tokens, __pyx_v_error->token->which, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_tokens, __pyx_v_error->wanted, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s____name__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":339 * txt = "Invalid token %s <%s> (expected <%s>)" % (error.token.value, * tokens[error.token.which].__name__, tokens[error.wanted].__name__) * elif error.reason == 4: # <<<<<<<<<<<<<< * txt = "just ran out of tokens... (expected '%s')" % error.text * elif error.reason == 5: */ __pyx_t_6 = (__pyx_v_error->reason == 4); if (__pyx_t_6) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":340 * tokens[error.token.which].__name__, tokens[error.wanted].__name__) * elif error.reason == 4: * txt = "just ran out of tokens... (expected '%s')" % error.text # <<<<<<<<<<<<<< * elif error.reason == 5: * txt = "Invalid token '%s' <%s> (expected '%s')" % (error.token.value, */ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_error->text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":341 * elif error.reason == 4: * txt = "just ran out of tokens... (expected '%s')" % error.text * elif error.reason == 5: # <<<<<<<<<<<<<< * txt = "Invalid token '%s' <%s> (expected '%s')" % (error.token.value, * tokens[error.token.which].__name__, */ __pyx_t_6 = (__pyx_v_error->reason == 5); if (__pyx_t_6) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":342 * txt = "just ran out of tokens... (expected '%s')" % error.text * elif error.reason == 5: * txt = "Invalid token '%s' <%s> (expected '%s')" % (error.token.value, # <<<<<<<<<<<<<< * tokens[error.token.which].__name__, * error.text) */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_error->token->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":343 * elif error.reason == 5: * txt = "Invalid token '%s' <%s> (expected '%s')" % (error.token.value, * tokens[error.token.which].__name__, # <<<<<<<<<<<<<< * error.text) * return txt */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tokens, __pyx_v_error->token->which, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":344 * txt = "Invalid token '%s' <%s> (expected '%s')" % (error.token.value, * tokens[error.token.which].__name__, * error.text) # <<<<<<<<<<<<<< * return txt * */ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_error->text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_txt); __pyx_v_txt = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L3; } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":345 * tokens[error.token.which].__name__, * error.text) * return txt # <<<<<<<<<<<<<< * * def get_ast(gid, text, start_i, ast_classes, ast_tokens): */ __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_v_txt); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_7; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("codetalker.cgrammar.format_parse_error"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_txt); __Pyx_DECREF(__pyx_v_rule_names); __Pyx_DECREF(__pyx_v_tokens); __Pyx_DECREF(__pyx_v_indent); __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":347 * return txt * * def get_ast(gid, text, start_i, ast_classes, ast_tokens): # <<<<<<<<<<<<<< * cdef Grammar* grammar = load_grammar(gid) * cdef Token* tokens */ static PyObject *__pyx_pf_10codetalker_8cgrammar_get_ast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pf_10codetalker_8cgrammar_get_ast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_gid = 0; PyObject *__pyx_v_text = 0; PyObject *__pyx_v_start_i = 0; PyObject *__pyx_v_ast_classes = 0; PyObject *__pyx_v_ast_tokens = 0; struct Grammar *__pyx_v_grammar; struct Token *__pyx_v_tokens; struct TokenStream __pyx_v_tstream; struct cParseNode *__pyx_v_ptree; PyObject *__pyx_v_ast; PyObject *__pyx_r = NULL; int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__gid,&__pyx_n_s__text,&__pyx_n_s__start_i,&__pyx_n_s__ast_classes,&__pyx_n_s__ast_tokens,0}; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("get_ast"); __Pyx_TraceCall("get_ast", __pyx_f[0], 347); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[5] = {0,0,0,0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gid); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__text); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_ast", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start_i); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_ast", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ast_classes); if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_ast", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ast_tokens); if (likely(values[4])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_ast", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_ast") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_gid = values[0]; __pyx_v_text = values[1]; __pyx_v_start_i = values[2]; __pyx_v_ast_classes = values[3]; __pyx_v_ast_tokens = values[4]; } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { __pyx_v_gid = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 1); __pyx_v_start_i = PyTuple_GET_ITEM(__pyx_args, 2); __pyx_v_ast_classes = PyTuple_GET_ITEM(__pyx_args, 3); __pyx_v_ast_tokens = PyTuple_GET_ITEM(__pyx_args, 4); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_ast", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("codetalker.cgrammar.get_ast"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_gid); __Pyx_INCREF(__pyx_v_text); __Pyx_INCREF(__pyx_v_start_i); __Pyx_INCREF(__pyx_v_ast_classes); __Pyx_INCREF(__pyx_v_ast_tokens); __pyx_v_ast = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":348 * * def get_ast(gid, text, start_i, ast_classes, ast_tokens): * cdef Grammar* grammar = load_grammar(gid) # <<<<<<<<<<<<<< * cdef Token* tokens * */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_grammar = load_grammar(__pyx_t_1); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":351 * cdef Token* tokens * * try_get_tokens(gid, text, &tokens) # <<<<<<<<<<<<<< * * cdef TokenStream tstream = tokens_to_stream(tokens) */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar_try_get_tokens(__pyx_t_1, __pyx_t_2, (&__pyx_v_tokens)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":353 * try_get_tokens(gid, text, &tokens) * * cdef TokenStream tstream = tokens_to_stream(tokens) # <<<<<<<<<<<<<< * tstream.eof = python_data[gid][1].index(EOF) * */ __pyx_v_tstream = __pyx_f_10codetalker_8cgrammar_tokens_to_stream(__pyx_v_tokens); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":354 * * cdef TokenStream tstream = tokens_to_stream(tokens) * tstream.eof = python_data[gid][1].index(EOF) # <<<<<<<<<<<<<< * * cdef cParseNode* ptree */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_gid); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__EOF); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tstream.eof = __pyx_t_6; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":357 * * cdef cParseNode* ptree * try_get_parse_tree(gid, text, start_i, &tstream, &ptree) # <<<<<<<<<<<<<< * if ptree == NULL: * return None */ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_text); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_start_i); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar_try_get_parse_tree(__pyx_t_1, __pyx_t_2, __pyx_t_7, (&__pyx_v_tstream), (&__pyx_v_ptree)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":358 * cdef cParseNode* ptree * try_get_parse_tree(gid, text, start_i, &tstream, &ptree) * if ptree == NULL: # <<<<<<<<<<<<<< * return None * ast = _get_ast(grammar, gid, ptree, ast_classes, ast_tokens) */ __pyx_t_8 = (__pyx_v_ptree == NULL); if (__pyx_t_8) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":359 * try_get_parse_tree(gid, text, start_i, &tstream, &ptree) * if ptree == NULL: * return None # <<<<<<<<<<<<<< * ast = _get_ast(grammar, gid, ptree, ast_classes, ast_tokens) * kill_ptree(ptree) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L6; } __pyx_L6:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":360 * if ptree == NULL: * return None * ast = _get_ast(grammar, gid, ptree, ast_classes, ast_tokens) # <<<<<<<<<<<<<< * kill_ptree(ptree) * kill_tokens(tokens) */ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_gid); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_f_10codetalker_8cgrammar__get_ast(__pyx_v_grammar, __pyx_t_7, __pyx_v_ptree, __pyx_v_ast_classes, __pyx_v_ast_tokens); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_ast); __pyx_v_ast = __pyx_t_3; __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":361 * return None * ast = _get_ast(grammar, gid, ptree, ast_classes, ast_tokens) * kill_ptree(ptree) # <<<<<<<<<<<<<< * kill_tokens(tokens) * return ast */ __pyx_f_10codetalker_8cgrammar_kill_ptree(__pyx_v_ptree); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":362 * ast = _get_ast(grammar, gid, ptree, ast_classes, ast_tokens) * kill_ptree(ptree) * kill_tokens(tokens) # <<<<<<<<<<<<<< * return ast * */ __pyx_f_10codetalker_8cgrammar_kill_tokens(__pyx_v_tokens); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":363 * kill_ptree(ptree) * kill_tokens(tokens) * return ast # <<<<<<<<<<<<<< * * cdef Token NO_TOKEN */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ast); __pyx_r = __pyx_v_ast; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("codetalker.cgrammar.get_ast"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_ast); __Pyx_DECREF(__pyx_v_gid); __Pyx_DECREF(__pyx_v_text); __Pyx_DECREF(__pyx_v_start_i); __Pyx_DECREF(__pyx_v_ast_classes); __Pyx_DECREF(__pyx_v_ast_tokens); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":371 * NO_TOKEN.which = 0 * * cdef Token* get_last_token(TokenStream* tokens): # <<<<<<<<<<<<<< * if not tokens.num: * return &NO_TOKEN */ static struct Token *__pyx_f_10codetalker_8cgrammar_get_last_token(struct TokenStream *__pyx_v_tokens) { struct Token *__pyx_r; int __pyx_t_1; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("get_last_token"); __Pyx_TraceCall("get_last_token", __pyx_f[0], 371); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":372 * * cdef Token* get_last_token(TokenStream* tokens): * if not tokens.num: # <<<<<<<<<<<<<< * return &NO_TOKEN * return &tokens.tokens[tokens.num-1] */ __pyx_t_1 = (!__pyx_v_tokens->num); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":373 * cdef Token* get_last_token(TokenStream* tokens): * if not tokens.num: * return &NO_TOKEN # <<<<<<<<<<<<<< * return &tokens.tokens[tokens.num-1] * */ __pyx_r = (&__pyx_v_10codetalker_8cgrammar_NO_TOKEN); goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":374 * if not tokens.num: * return &NO_TOKEN * return &tokens.tokens[tokens.num-1] # <<<<<<<<<<<<<< * * ### CONVERT STUFF ### */ __pyx_r = (&(__pyx_v_tokens->tokens[(__pyx_v_tokens->num - 1)])); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":378 * ### CONVERT STUFF ### * * cdef TokenStream tokens_to_stream(Token* tokens): # <<<<<<<<<<<<<< * cdef TokenStream ts * ts.num = 0 */ static struct TokenStream __pyx_f_10codetalker_8cgrammar_tokens_to_stream(struct Token *__pyx_v_tokens) { struct TokenStream __pyx_v_ts; struct Token *__pyx_v_tmp; PyObject *__pyx_v_i; struct TokenStream __pyx_r; int __pyx_t_1; unsigned int __pyx_t_2; unsigned long __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("tokens_to_stream"); __Pyx_TraceCall("tokens_to_stream", __pyx_f[0], 378); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":380 * cdef TokenStream tokens_to_stream(Token* tokens): * cdef TokenStream ts * ts.num = 0 # <<<<<<<<<<<<<< * cdef Token* tmp = tokens * while tmp != NULL: */ __pyx_v_ts.num = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":381 * cdef TokenStream ts * ts.num = 0 * cdef Token* tmp = tokens # <<<<<<<<<<<<<< * while tmp != NULL: * ts.num += 1 */ __pyx_v_tmp = __pyx_v_tokens; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":382 * ts.num = 0 * cdef Token* tmp = tokens * while tmp != NULL: # <<<<<<<<<<<<<< * ts.num += 1 * tmp = tmp.next */ while (1) { __pyx_t_1 = (__pyx_v_tmp != NULL); if (!__pyx_t_1) break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":383 * cdef Token* tmp = tokens * while tmp != NULL: * ts.num += 1 # <<<<<<<<<<<<<< * tmp = tmp.next * ts.tokens = malloc(sizeof(Token)*ts.num) */ __pyx_v_ts.num += 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":384 * while tmp != NULL: * ts.num += 1 * tmp = tmp.next # <<<<<<<<<<<<<< * ts.tokens = malloc(sizeof(Token)*ts.num) * ts.at = 0 */ __pyx_v_tmp = __pyx_v_tmp->next; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":385 * ts.num += 1 * tmp = tmp.next * ts.tokens = malloc(sizeof(Token)*ts.num) # <<<<<<<<<<<<<< * ts.at = 0 * for i from 0<=imalloc(sizeof(Token)*ts.num) * ts.at = 0 # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(Token)*ts.num) * ts.at = 0 * for i from 0<=inext; __pyx_t_3 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_i); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":387 * ts.tokens = malloc(sizeof(Token)*ts.num) * ts.at = 0 * for i from 0<=imalloc(sizeof(Rule)*crules.num) * for i from 0<=imalloc(sizeof(Rule)*crules.num) # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(Rule)*crules.num) * for i from 0<=imalloc(sizeof(Rule)*crules.num) * for i from 0<=imalloc(sizeof(Rule)*crules.num) * for i from 0<=imalloc(sizeof(RuleOption)*crule.num) */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_rule, __pyx_n_s__dont_ignore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_crule.dont_ignore = __pyx_t_2; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":404 * crule.which = i * crule.dont_ignore = rule.dont_ignore * crule.num = len(rule.options) # <<<<<<<<<<<<<< * crule.options = malloc(sizeof(RuleOption)*crule.num) * crule.name = rule.name */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_rule, __pyx_n_s__options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_crule.num = __pyx_t_3; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":405 * crule.dont_ignore = rule.dont_ignore * crule.num = len(rule.options) * crule.options = malloc(sizeof(RuleOption)*crule.num) # <<<<<<<<<<<<<< * crule.name = rule.name * crule.keep_tree = rule.keep_tree */ __pyx_v_crule.options = ((struct RuleOption *)malloc(((sizeof(struct RuleOption)) * __pyx_v_crule.num))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":406 * crule.num = len(rule.options) * crule.options = malloc(sizeof(RuleOption)*crule.num) * crule.name = rule.name # <<<<<<<<<<<<<< * crule.keep_tree = rule.keep_tree * for i from 0<=imalloc(sizeof(RuleOption)*crule.num) * crule.name = rule.name * crule.keep_tree = rule.keep_tree # <<<<<<<<<<<<<< * for i from 0<=i__pyx_n > 0) { __pyx_v_to_or = __pyx_optional_args->to_or; } } __Pyx_INCREF(__pyx_v_option); __Pyx_INCREF(__pyx_v_to_or); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":414 * cdef RuleOption convert_option(object option, to_or=False): * cdef RuleOption coption * coption.num = len(option) # <<<<<<<<<<<<<< * coption.items = malloc(sizeof(RuleItem) * coption.num) * for i from 0<=imalloc(sizeof(RuleItem) * coption.num) # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(RuleItem) * coption.num) * for i from 0<=imalloc(sizeof(RuleItem) * coption.num) * for i from 0<=imalloc(sizeof(RuleItem) * coption.num) * for i from 0<=i__pyx_n > 0) { __pyx_v_from_or = __pyx_optional_args->from_or; } } __Pyx_INCREF(__pyx_v_item); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":423 * cdef RuleItem citem * cdef RuleOption* option * cdef bint to_or = False # <<<<<<<<<<<<<< * if type(item) == int: * # rule or token */ __pyx_v_to_or = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":424 * cdef RuleOption* option * cdef bint to_or = False * if type(item) == int: # <<<<<<<<<<<<<< * # rule or token * if item >= 0: */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_item)), ((PyObject *)((PyObject*)&PyInt_Type)), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":426 * if type(item) == int: * # rule or token * if item >= 0: # <<<<<<<<<<<<<< * citem.type = RULE * citem.value.which = item */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_GE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":427 * # rule or token * if item >= 0: * citem.type = RULE # <<<<<<<<<<<<<< * citem.value.which = item * else: */ __pyx_v_citem.type = RULE; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":428 * if item >= 0: * citem.type = RULE * citem.value.which = item # <<<<<<<<<<<<<< * else: * citem.type = TOKEN */ __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_item); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_citem.value.which = __pyx_t_3; goto __pyx_L4; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":430 * citem.value.which = item * else: * citem.type = TOKEN # <<<<<<<<<<<<<< * citem.value.which = -(item + 1) * elif type(item) == str: */ __pyx_v_citem.type = TOKEN; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":431 * else: * citem.type = TOKEN * citem.value.which = -(item + 1) # <<<<<<<<<<<<<< * elif type(item) == str: * citem.type = LITERAL */ __pyx_t_1 = PyNumber_Add(__pyx_v_item, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_citem.value.which = __pyx_t_3; } __pyx_L4:; goto __pyx_L3; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":432 * citem.type = TOKEN * citem.value.which = -(item + 1) * elif type(item) == str: # <<<<<<<<<<<<<< * citem.type = LITERAL * citem.value.text = item */ __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_item)), ((PyObject *)((PyObject*)&PyString_Type)), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":433 * citem.value.which = -(item + 1) * elif type(item) == str: * citem.type = LITERAL # <<<<<<<<<<<<<< * citem.value.text = item * else: */ __pyx_v_citem.type = LITERAL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":434 * elif type(item) == str: * citem.type = LITERAL * citem.value.text = item # <<<<<<<<<<<<<< * else: * citem.type = SPECIAL */ __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_item); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_citem.value.text = __pyx_t_5; goto __pyx_L3; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":436 * citem.value.text = item * else: * citem.type = SPECIAL # <<<<<<<<<<<<<< * citem.value.special.option = malloc(sizeof(RuleOption)) * if from_or: */ __pyx_v_citem.type = SPECIAL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":437 * else: * citem.type = SPECIAL * citem.value.special.option = malloc(sizeof(RuleOption)) # <<<<<<<<<<<<<< * if from_or: * citem.value.special.type = STRAIGHT */ __pyx_v_citem.value.special.option = ((struct RuleOption *)malloc((sizeof(struct RuleOption)))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":438 * citem.type = SPECIAL * citem.value.special.option = malloc(sizeof(RuleOption)) * if from_or: # <<<<<<<<<<<<<< * citem.value.special.type = STRAIGHT * citem.value.special.option[0] = convert_option(item) */ __pyx_t_2 = __pyx_v_from_or; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":439 * citem.value.special.option = malloc(sizeof(RuleOption)) * if from_or: * citem.value.special.type = STRAIGHT # <<<<<<<<<<<<<< * citem.value.special.option[0] = convert_option(item) * return citem */ __pyx_v_citem.value.special.type = STRAIGHT; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":440 * if from_or: * citem.value.special.type = STRAIGHT * citem.value.special.option[0] = convert_option(item) # <<<<<<<<<<<<<< * return citem * if item[0] == '*': */ (__pyx_v_citem.value.special.option[0]) = __pyx_f_10codetalker_8cgrammar_convert_option(__pyx_v_item, NULL); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":441 * citem.value.special.type = STRAIGHT * citem.value.special.option[0] = convert_option(item) * return citem # <<<<<<<<<<<<<< * if item[0] == '*': * citem.value.special.type = STAR */ __pyx_r = __pyx_v_citem; goto __pyx_L0; goto __pyx_L5; } __pyx_L5:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":442 * citem.value.special.option[0] = convert_option(item) * return citem * if item[0] == '*': # <<<<<<<<<<<<<< * citem.value.special.type = STAR * elif item[0] == '+': */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_item, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_kp_s_11), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":443 * return citem * if item[0] == '*': * citem.value.special.type = STAR # <<<<<<<<<<<<<< * elif item[0] == '+': * citem.value.special.type = PLUS */ __pyx_v_citem.value.special.type = STAR; goto __pyx_L6; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":444 * if item[0] == '*': * citem.value.special.type = STAR * elif item[0] == '+': # <<<<<<<<<<<<<< * citem.value.special.type = PLUS * elif item[0] == '|': */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_item, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_kp_s_12), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":445 * citem.value.special.type = STAR * elif item[0] == '+': * citem.value.special.type = PLUS # <<<<<<<<<<<<<< * elif item[0] == '|': * citem.value.special.type = OR */ __pyx_v_citem.value.special.type = PLUS; goto __pyx_L6; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":446 * elif item[0] == '+': * citem.value.special.type = PLUS * elif item[0] == '|': # <<<<<<<<<<<<<< * citem.value.special.type = OR * to_or = True */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_item, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_kp_s_13), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":447 * citem.value.special.type = PLUS * elif item[0] == '|': * citem.value.special.type = OR # <<<<<<<<<<<<<< * to_or = True * elif item[0] == '?': */ __pyx_v_citem.value.special.type = OR; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":448 * elif item[0] == '|': * citem.value.special.type = OR * to_or = True # <<<<<<<<<<<<<< * elif item[0] == '?': * citem.value.special.type = QUESTION */ __pyx_v_to_or = 1; goto __pyx_L6; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":449 * citem.value.special.type = OR * to_or = True * elif item[0] == '?': # <<<<<<<<<<<<<< * citem.value.special.type = QUESTION * elif item[0] == '!': */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_item, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_kp_s_14), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":450 * to_or = True * elif item[0] == '?': * citem.value.special.type = QUESTION # <<<<<<<<<<<<<< * elif item[0] == '!': * citem.value.special.type = NOT */ __pyx_v_citem.value.special.type = QUESTION; goto __pyx_L6; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":451 * elif item[0] == '?': * citem.value.special.type = QUESTION * elif item[0] == '!': # <<<<<<<<<<<<<< * citem.value.special.type = NOT * elif item[0] == 'i': */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_item, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_kp_s_15), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":452 * citem.value.special.type = QUESTION * elif item[0] == '!': * citem.value.special.type = NOT # <<<<<<<<<<<<<< * elif item[0] == 'i': * citem.value.special.type = NOIGNORE */ __pyx_v_citem.value.special.type = NOT; goto __pyx_L6; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":453 * elif item[0] == '!': * citem.value.special.type = NOT * elif item[0] == 'i': # <<<<<<<<<<<<<< * citem.value.special.type = NOIGNORE * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_item, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__i), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":454 * citem.value.special.type = NOT * elif item[0] == 'i': * citem.value.special.type = NOIGNORE # <<<<<<<<<<<<<< * * citem.value.special.option[0] = convert_option(item[1:], to_or) */ __pyx_v_citem.value.special.type = NOIGNORE; goto __pyx_L6; } __pyx_L6:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":456 * citem.value.special.type = NOIGNORE * * citem.value.special.option[0] = convert_option(item[1:], to_or) # <<<<<<<<<<<<<< * return citem * */ __pyx_t_4 = PySequence_GetSlice(__pyx_v_item, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_to_or); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7.__pyx_n = 1; __pyx_t_7.to_or = __pyx_t_1; __pyx_t_6 = __pyx_f_10codetalker_8cgrammar_convert_option(__pyx_t_4, &__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_citem.value.special.option[0]) = __pyx_t_6; } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":457 * * citem.value.special.option[0] = convert_option(item[1:], to_or) * return citem # <<<<<<<<<<<<<< * * cdef IgnoreTokens convert_ignore(object ignore, object tokens): */ __pyx_r = __pyx_v_citem; goto __pyx_L0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("codetalker.cgrammar.convert_item"); __pyx_L0:; __Pyx_DECREF(__pyx_v_item); __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":459 * return citem * * cdef IgnoreTokens convert_ignore(object ignore, object tokens): # <<<<<<<<<<<<<< * cdef IgnoreTokens itokens * itokens.num = len(ignore) */ static struct IgnoreTokens __pyx_f_10codetalker_8cgrammar_convert_ignore(PyObject *__pyx_v_ignore, PyObject *__pyx_v_tokens) { struct IgnoreTokens __pyx_v_itokens; PyObject *__pyx_v_i; struct IgnoreTokens __pyx_r; Py_ssize_t __pyx_t_1; unsigned int __pyx_t_2; unsigned long __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("convert_ignore"); __Pyx_TraceCall("convert_ignore", __pyx_f[0], 459); __Pyx_INCREF(__pyx_v_ignore); __Pyx_INCREF(__pyx_v_tokens); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":461 * cdef IgnoreTokens convert_ignore(object ignore, object tokens): * cdef IgnoreTokens itokens * itokens.num = len(ignore) # <<<<<<<<<<<<<< * itokens.tokens = malloc(sizeof(unsigned int)*itokens.num) * for i from 0<=imalloc(sizeof(unsigned int)*itokens.num) # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(unsigned int)*itokens.num) * for i from 0<=imalloc(sizeof(unsigned int)*itokens.num) * for i from 0<=imalloc(sizeof(unsigned int)*itokens.num) * for i from 0<=imalloc(sizeof(AstAttrs)*len(ast_attrs)) * attrs[0] = result */ static PyObject *__pyx_f_10codetalker_8cgrammar_convert_ast_attrs(PyObject *__pyx_v_ast_attrs, PyObject *__pyx_v_rules, PyObject *__pyx_v_tokens, struct AstAttrs **__pyx_v_attrs) { struct AstAttrs *__pyx_v_result; PyObject *__pyx_v_i; PyObject *__pyx_v_keys; PyObject *__pyx_v_m; PyObject *__pyx_r = NULL; Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; unsigned int __pyx_t_8; unsigned long __pyx_t_9; char *__pyx_t_10; PyObject *__pyx_t_11 = NULL; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("convert_ast_attrs"); __Pyx_TraceCall("convert_ast_attrs", __pyx_f[0], 467); __Pyx_INCREF(__pyx_v_ast_attrs); __Pyx_INCREF(__pyx_v_rules); __Pyx_INCREF(__pyx_v_tokens); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); __pyx_v_keys = Py_None; __Pyx_INCREF(Py_None); __pyx_v_m = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":468 * * cdef object convert_ast_attrs(object ast_attrs, object rules, object tokens, AstAttrs** attrs): * cdef AstAttrs* result = malloc(sizeof(AstAttrs)*len(ast_attrs)) # <<<<<<<<<<<<<< * attrs[0] = result * for i from 0<=imalloc(sizeof(AstAttrs)*len(ast_attrs)) * attrs[0] = result # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(AstAttrs)*len(ast_attrs)) * attrs[0] = result * for i from 0<=imalloc(sizeof(AstAttr)*result[i].num); */ __pyx_t_6 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_result[__pyx_t_7]).num = __pyx_t_6; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":479 * keys = ast_attrs[i]['attrs'].keys() * result[i].num = len(keys) * if len(keys): # <<<<<<<<<<<<<< * result[i].attrs = malloc(sizeof(AstAttr)*result[i].num); * else: */ __pyx_t_7 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":480 * result[i].num = len(keys) * if len(keys): * result[i].attrs = malloc(sizeof(AstAttr)*result[i].num); # <<<<<<<<<<<<<< * else: * result[i].attrs = NULL */ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_result[__pyx_t_6]).attrs = ((struct AstAttr *)malloc(((sizeof(struct AstAttr)) * (__pyx_v_result[__pyx_t_7]).num))); goto __pyx_L6; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":482 * result[i].attrs = malloc(sizeof(AstAttr)*result[i].num); * else: * result[i].attrs = NULL # <<<<<<<<<<<<<< * * for m from 0<=mmalloc(sizeof(AstAttrs)*len(ast_attrs)) * attrs[0] = result * for i from 0<=iname = __pyx_v_name; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":496 * cdef object convert_ast_attr(char* name, object ast_attr, object rules, object tokens, AstAttr* attr): * attr.name = name * if type(ast_attr) != dict: # <<<<<<<<<<<<<< * ast_attr = {'type':ast_attr} * attr.single = ast_attr.get('single', type(ast_attr.get('type')) not in (list, tuple)) */ __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_ast_attr)), ((PyObject *)((PyObject*)&PyDict_Type)), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":497 * attr.name = name * if type(ast_attr) != dict: * ast_attr = {'type':ast_attr} # <<<<<<<<<<<<<< * attr.single = ast_attr.get('single', type(ast_attr.get('type')) not in (list, tuple)) * if type(ast_attr.get('type')) not in (tuple, list): */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__type), __pyx_v_ast_attr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_v_ast_attr); __pyx_v_ast_attr = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":498 * if type(ast_attr) != dict: * ast_attr = {'type':ast_attr} * attr.single = ast_attr.get('single', type(ast_attr.get('type')) not in (list, tuple)) # <<<<<<<<<<<<<< * if type(ast_attr.get('type')) not in (tuple, list): * ast_attr['type'] = [ast_attr['type']] */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_ast_attr, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetAttr(__pyx_v_ast_attr, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_n_s__type)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__type)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type)); __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_5))); __pyx_t_4 = ((PyObject *)Py_TYPE(__pyx_t_5)); __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_4), ((PyObject *)((PyObject*)&PyList_Type)), Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((int)__pyx_t_2); if (__pyx_t_6) { __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_4), ((PyObject *)((PyObject*)&PyTuple_Type)), Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = ((int)__pyx_t_2); __pyx_t_2 = __pyx_t_7; } else { __pyx_t_2 = __pyx_t_6; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_n_s__single)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__single)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__single)); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_attr->single = __pyx_t_8; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":499 * ast_attr = {'type':ast_attr} * attr.single = ast_attr.get('single', type(ast_attr.get('type')) not in (list, tuple)) * if type(ast_attr.get('type')) not in (tuple, list): # <<<<<<<<<<<<<< * ast_attr['type'] = [ast_attr['type']] * attr.numtypes = len(ast_attr['type']) */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_ast_attr, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_n_s__type)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__type)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__type)); __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_1))); __pyx_t_5 = ((PyObject *)Py_TYPE(__pyx_t_1)); __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)((PyObject*)&PyTuple_Type)), Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = ((int)__pyx_t_2); if (__pyx_t_6) { __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)((PyObject*)&PyList_Type)), Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = ((int)__pyx_t_2); __pyx_t_2 = __pyx_t_7; } else { __pyx_t_2 = __pyx_t_6; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":500 * attr.single = ast_attr.get('single', type(ast_attr.get('type')) not in (list, tuple)) * if type(ast_attr.get('type')) not in (tuple, list): * ast_attr['type'] = [ast_attr['type']] # <<<<<<<<<<<<<< * attr.numtypes = len(ast_attr['type']) * attr.types = malloc(sizeof(int)*attr.numtypes) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_ast_attr, ((PyObject *)__pyx_n_s__type)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; if (PyObject_SetItem(__pyx_v_ast_attr, ((PyObject *)__pyx_n_s__type), ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L4; } __pyx_L4:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":501 * if type(ast_attr.get('type')) not in (tuple, list): * ast_attr['type'] = [ast_attr['type']] * attr.numtypes = len(ast_attr['type']) # <<<<<<<<<<<<<< * attr.types = malloc(sizeof(int)*attr.numtypes) * for i from 0<=inumtypes = __pyx_t_9; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":502 * ast_attr['type'] = [ast_attr['type']] * attr.numtypes = len(ast_attr['type']) * attr.types = malloc(sizeof(int)*attr.numtypes) # <<<<<<<<<<<<<< * for i from 0<=itypes = ((int *)malloc(((sizeof(int)) * __pyx_v_attr->numtypes))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":503 * attr.numtypes = len(ast_attr['type']) * attr.types = malloc(sizeof(int)*attr.numtypes) * for i from 0<=inumtypes; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_8; __pyx_t_10++) { __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_5; __pyx_t_5 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":504 * attr.types = malloc(sizeof(int)*attr.numtypes) * for i from 0<=itypes[__pyx_t_9]) = __pyx_t_11; __pyx_t_10 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_i); if (unlikely((__pyx_t_10 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":503 * attr.numtypes = len(ast_attr['type']) * attr.types = malloc(sizeof(int)*attr.numtypes) * for i from 0<=istart = __pyx_t_11; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":507 * * attr.start = ast_attr.get('start', 0) * attr.end = ast_attr.get('end', 0) # <<<<<<<<<<<<<< * attr.step = ast_attr.get('step', 1) * */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_ast_attr, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_n_s__end)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__end)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__end)); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_attr->end = __pyx_t_11; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":508 * attr.start = ast_attr.get('start', 0) * attr.end = ast_attr.get('end', 0) * attr.step = ast_attr.get('step', 1) # <<<<<<<<<<<<<< * * cdef PTokens convert_ptokens(object tokens): */ __pyx_t_5 = PyObject_GetAttr(__pyx_v_ast_attr, __pyx_n_s__get); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_n_s__step)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__step)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__step)); __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_attr->step = __pyx_t_11; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("codetalker.cgrammar.convert_ast_attr"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_i); __Pyx_DECREF(__pyx_v_ast_attr); __Pyx_DECREF(__pyx_v_rules); __Pyx_DECREF(__pyx_v_tokens); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":510 * attr.step = ast_attr.get('step', 1) * * cdef PTokens convert_ptokens(object tokens): # <<<<<<<<<<<<<< * cdef PTokens ptokens * ptokens.num = len(tokens) - 3 # don't include INDENT, DEDENT, and EOF */ static struct PTokens __pyx_f_10codetalker_8cgrammar_convert_ptokens(PyObject *__pyx_v_tokens) { struct PTokens __pyx_v_ptokens; PyObject *__pyx_v_i; PyObject *__pyx_v_m; struct PTokens __pyx_r; Py_ssize_t __pyx_t_1; unsigned int __pyx_t_2; unsigned long __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; unsigned int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; long __pyx_t_10; char *__pyx_t_11; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("convert_ptokens"); __Pyx_TraceCall("convert_ptokens", __pyx_f[0], 510); __Pyx_INCREF(__pyx_v_tokens); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); __pyx_v_m = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":512 * cdef PTokens convert_ptokens(object tokens): * cdef PTokens ptokens * ptokens.num = len(tokens) - 3 # don't include INDENT, DEDENT, and EOF # <<<<<<<<<<<<<< * ptokens.tokens = malloc(sizeof(PToken)*ptokens.num) * for i from 0<=imalloc(sizeof(PToken)*ptokens.num) # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(PToken)*ptokens.num) * for i from 0<=imalloc(sizeof(PToken)*ptokens.num) * for i from 0<=imalloc(sizeof(char*)*ptokens.tokens[i].num) */ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_1]).type = STRTOKEN; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":524 * elif issubclass(tokens[i], StringToken): * ptokens.tokens[i].type = STRTOKEN * ptokens.tokens[i].num = len(tokens[i].strings) # <<<<<<<<<<<<<< * ptokens.tokens[i].value.strings = malloc(sizeof(char*)*ptokens.tokens[i].num) * # cache = ''.join(st[0] for st in tokens[i].strings) */ __pyx_t_4 = PyObject_GetItem(__pyx_v_tokens, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__strings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_9]).num = __pyx_t_1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":525 * ptokens.tokens[i].type = STRTOKEN * ptokens.tokens[i].num = len(tokens[i].strings) * ptokens.tokens[i].value.strings = malloc(sizeof(char*)*ptokens.tokens[i].num) # <<<<<<<<<<<<<< * # cache = ''.join(st[0] for st in tokens[i].strings) * # ptokens.tokens[i].cache = cache */ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_1]).value.strings = ((char **)malloc(((sizeof(char *)) * (__pyx_v_ptokens.tokens[__pyx_t_9]).num))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":528 * # cache = ''.join(st[0] for st in tokens[i].strings) * # ptokens.tokens[i].cache = cache * for m from 0<=mmalloc(sizeof(char*)*ptokens.tokens[i].num) */ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_1]).type = IDTOKEN; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":536 * elif issubclass(tokens[i], IdToken): * ptokens.tokens[i].type = IDTOKEN * ptokens.tokens[i].num = len(tokens[i].strings) # <<<<<<<<<<<<<< * ptokens.tokens[i].value.strings = malloc(sizeof(char*)*ptokens.tokens[i].num) * # cache = ''.join(st[0] for st in tokens[i].strings) */ __pyx_t_5 = PyObject_GetItem(__pyx_v_tokens, __pyx_v_i); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__strings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_9]).num = __pyx_t_1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":537 * ptokens.tokens[i].type = IDTOKEN * ptokens.tokens[i].num = len(tokens[i].strings) * ptokens.tokens[i].value.strings = malloc(sizeof(char*)*ptokens.tokens[i].num) # <<<<<<<<<<<<<< * # cache = ''.join(st[0] for st in tokens[i].strings) * # ptokens.tokens[i].cache = cache */ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_1]).value.strings = ((char **)malloc(((sizeof(char *)) * (__pyx_v_ptokens.tokens[__pyx_t_9]).num))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":540 * # cache = ''.join(st[0] for st in tokens[i].strings) * # ptokens.tokens[i].cache = cache * for m from 0<=mmalloc(sizeof(char*)*ptokens.tokens[i].num) */ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_9]).type = IIDTOKEN; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":544 * elif issubclass(tokens[i], IIdToken): * ptokens.tokens[i].type = IIDTOKEN * ptokens.tokens[i].num = len(tokens[i].strings) # <<<<<<<<<<<<<< * ptokens.tokens[i].value.strings = malloc(sizeof(char*)*ptokens.tokens[i].num) * # cache = ''.join(st[0] for st in tokens[i].strings) */ __pyx_t_5 = PyObject_GetItem(__pyx_v_tokens, __pyx_v_i); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__strings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_1]).num = __pyx_t_9; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":545 * ptokens.tokens[i].type = IIDTOKEN * ptokens.tokens[i].num = len(tokens[i].strings) * ptokens.tokens[i].value.strings = malloc(sizeof(char*)*ptokens.tokens[i].num) # <<<<<<<<<<<<<< * # cache = ''.join(st[0] for st in tokens[i].strings) * # ptokens.tokens[i].cache = cache */ __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_ptokens.tokens[__pyx_t_9]).value.strings = ((char **)malloc(((sizeof(char *)) * (__pyx_v_ptokens.tokens[__pyx_t_1]).num))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":548 * # cache = ''.join(st[0] for st in tokens[i].strings) * # ptokens.tokens[i].cache = cache * for m from 0<=mmalloc(sizeof(PToken)*ptokens.num) * for i from 0<=iwhich, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_start->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_start->lineno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_start->charno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":561 * while start != NULL: * res.append(python_data[gid][1][start.which](start.value, start.lineno, start.charno)) * start = start.next # <<<<<<<<<<<<<< * return res * */ __pyx_v_start = __pyx_v_start->next; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":562 * res.append(python_data[gid][1][start.which](start.value, start.lineno, start.charno)) * start = start.next * return res # <<<<<<<<<<<<<< * * class ParseNode(object): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_res); __pyx_r = __pyx_v_res; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("codetalker.cgrammar.convert_back_tokens"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_res); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":565 * * class ParseNode(object): * def __init__(self, rule, name): # <<<<<<<<<<<<<< * self.rule = rule * self.name = name */ static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_10codetalker_8cgrammar_9ParseNode___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_10codetalker_8cgrammar_9ParseNode___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_rule = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__rule,&__pyx_n_s__name,0}; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("__init__"); __Pyx_TraceCall("__init__", __pyx_f[0], 565); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rule); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_rule = values[1]; __pyx_v_name = values[2]; } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_rule = PyTuple_GET_ITEM(__pyx_args, 1); __pyx_v_name = PyTuple_GET_ITEM(__pyx_args, 2); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.__init__"); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":566 * class ParseNode(object): * def __init__(self, rule, name): * self.rule = rule # <<<<<<<<<<<<<< * self.name = name * self.children = [] */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__rule, __pyx_v_rule) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":567 * def __init__(self, rule, name): * self.rule = rule * self.name = name # <<<<<<<<<<<<<< * self.children = [] * self.parent = None */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__name, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":568 * self.rule = rule * self.name = name * self.children = [] # <<<<<<<<<<<<<< * self.parent = None * */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__children, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":569 * self.name = name * self.children = [] * self.parent = None # <<<<<<<<<<<<<< * * def append(self, child): */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__parent, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.__init__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":571 * self.parent = None * * def append(self, child): # <<<<<<<<<<<<<< * self.children.append(child) * child.parent = self */ static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode_append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_10codetalker_8cgrammar_9ParseNode_append = {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pf_10codetalker_8cgrammar_9ParseNode_append, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode_append(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_child = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__child,0}; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("append"); __Pyx_TraceCall("append", __pyx_f[0], 571); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__child); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "append") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_child = values[1]; } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_child = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("append", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.append"); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":572 * * def append(self, child): * self.children.append(child) # <<<<<<<<<<<<<< * child.parent = self * */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_child); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":573 * def append(self, child): * self.children.append(child) * child.parent = self # <<<<<<<<<<<<<< * * def prepend(self, child): */ if (PyObject_SetAttr(__pyx_v_child, __pyx_n_s__parent, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.append"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":575 * child.parent = self * * def prepend(self, child): # <<<<<<<<<<<<<< * self.children.insert(0, child) * child.parent = self */ static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode_prepend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_10codetalker_8cgrammar_9ParseNode_prepend = {__Pyx_NAMESTR("prepend"), (PyCFunction)__pyx_pf_10codetalker_8cgrammar_9ParseNode_prepend, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode_prepend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_child = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__child,0}; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("prepend"); __Pyx_TraceCall("prepend", __pyx_f[0], 575); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__child); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("prepend", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "prepend") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_child = values[1]; } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_child = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("prepend", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.prepend"); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":576 * * def prepend(self, child): * self.children.insert(0, child) # <<<<<<<<<<<<<< * child.parent = self * */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__insert); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __Pyx_INCREF(__pyx_v_child); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_child); __Pyx_GIVEREF(__pyx_v_child); __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":577 * def prepend(self, child): * self.children.insert(0, child) * child.parent = self # <<<<<<<<<<<<<< * * def __str__(self): */ if (PyObject_SetAttr(__pyx_v_child, __pyx_n_s__parent, __pyx_v_self) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.prepend"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":579 * child.parent = self * * def __str__(self): # <<<<<<<<<<<<<< * strs = [] * for child in self.children: */ static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode___str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_10codetalker_8cgrammar_9ParseNode___str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_10codetalker_8cgrammar_9ParseNode___str__, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode___str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_strs; PyObject *__pyx_v_child; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("__str__"); __Pyx_TraceCall("__str__", __pyx_f[0], 579); __pyx_self = __pyx_self; __Pyx_INCREF(__pyx_v_self); __pyx_v_strs = Py_None; __Pyx_INCREF(Py_None); __pyx_v_child = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":580 * * def __str__(self): * strs = [] # <<<<<<<<<<<<<< * for child in self.children: * strs.append(str(child)) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_v_strs); __pyx_v_strs = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":581 * def __str__(self): * strs = [] * for child in self.children: # <<<<<<<<<<<<<< * strs.append(str(child)) * return ''.join(strs) */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; } else { __pyx_t_1 = PyIter_Next(__pyx_t_3); if (!__pyx_t_1) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_v_child); __pyx_v_child = __pyx_t_1; __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":582 * strs = [] * for child in self.children: * strs.append(str(child)) # <<<<<<<<<<<<<< * return ''.join(strs) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_child); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_child); __Pyx_GIVEREF(__pyx_v_child); __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_strs, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":583 * for child in self.children: * strs.append(str(child)) * return ''.join(strs) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_strs); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_strs); __Pyx_GIVEREF(__pyx_v_strs); __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.__str__"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_strs); __Pyx_DECREF(__pyx_v_child); __Pyx_DECREF(__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":585 * return ''.join(strs) * * def __repr__(self): # <<<<<<<<<<<<<< * return u'' % (self.name, self.rule, len(self.children), str(self)) * */ static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode___repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_10codetalker_8cgrammar_9ParseNode___repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_10codetalker_8cgrammar_9ParseNode___repr__, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_10codetalker_8cgrammar_9ParseNode___repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("__repr__"); __Pyx_TraceCall("__repr__", __pyx_f[0], 585); __pyx_self = __pyx_self; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":586 * * def __repr__(self): * return u'' % (self.name, self.rule, len(self.children), str(self)) # <<<<<<<<<<<<<< * * cdef object convert_back_ptree(int gid, cParseNode* node): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_17), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("codetalker.cgrammar.ParseNode.__repr__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":588 * return u'' % (self.name, self.rule, len(self.children), str(self)) * * cdef object convert_back_ptree(int gid, cParseNode* node): # <<<<<<<<<<<<<< * '''convert a cParseNode struct back to a python object''' * if node.type == NTOKEN: */ static PyObject *__pyx_f_10codetalker_8cgrammar_convert_back_ptree(int __pyx_v_gid, struct cParseNode *__pyx_v_node) { PyObject *__pyx_v_current; struct cParseNode *__pyx_v_child; PyObject *__pyx_v_res; PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("convert_back_ptree"); __Pyx_TraceCall("convert_back_ptree", __pyx_f[0], 588); __pyx_v_current = Py_None; __Pyx_INCREF(Py_None); __pyx_v_res = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":590 * cdef object convert_back_ptree(int gid, cParseNode* node): * '''convert a cParseNode struct back to a python object''' * if node.type == NTOKEN: # <<<<<<<<<<<<<< * if node.token.value == NULL: * return None */ __pyx_t_1 = (__pyx_v_node->type == NTOKEN); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":591 * '''convert a cParseNode struct back to a python object''' * if node.type == NTOKEN: * if node.token.value == NULL: # <<<<<<<<<<<<<< * return None * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) */ __pyx_t_1 = (__pyx_v_node->token->value == NULL); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":592 * if node.type == NTOKEN: * if node.token.value == NULL: * return None # <<<<<<<<<<<<<< * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) * current = ParseNode(node.rule, python_data[gid][0][node.rule]) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L4; } __pyx_L4:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":593 * if node.token.value == NULL: * return None * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) # <<<<<<<<<<<<<< * current = ParseNode(node.rule, python_data[gid][0][node.rule]) * cdef cParseNode* child = node.child */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_node->token->which, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_node->token->value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_node->token->lineno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_node->token->charno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":594 * return None * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) * current = ParseNode(node.rule, python_data[gid][0][node.rule]) # <<<<<<<<<<<<<< * cdef cParseNode* child = node.child * while child != NULL: */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__ParseNode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_node->rule); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_node->rule, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_current); __pyx_v_current = __pyx_t_4; __pyx_t_4 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":595 * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) * current = ParseNode(node.rule, python_data[gid][0][node.rule]) * cdef cParseNode* child = node.child # <<<<<<<<<<<<<< * while child != NULL: * res = convert_back_ptree(gid, child) */ __pyx_v_child = __pyx_v_node->child; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":596 * current = ParseNode(node.rule, python_data[gid][0][node.rule]) * cdef cParseNode* child = node.child * while child != NULL: # <<<<<<<<<<<<<< * res = convert_back_ptree(gid, child) * if res is not None: */ while (1) { __pyx_t_1 = (__pyx_v_child != NULL); if (!__pyx_t_1) break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":597 * cdef cParseNode* child = node.child * while child != NULL: * res = convert_back_ptree(gid, child) # <<<<<<<<<<<<<< * if res is not None: * current.prepend(res) */ __pyx_t_4 = __pyx_f_10codetalker_8cgrammar_convert_back_ptree(__pyx_v_gid, __pyx_v_child); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_res); __pyx_v_res = __pyx_t_4; __pyx_t_4 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":598 * while child != NULL: * res = convert_back_ptree(gid, child) * if res is not None: # <<<<<<<<<<<<<< * current.prepend(res) * child = child.prev */ __pyx_t_1 = (__pyx_v_res != Py_None); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":599 * res = convert_back_ptree(gid, child) * if res is not None: * current.prepend(res) # <<<<<<<<<<<<<< * child = child.prev * return current */ __pyx_t_4 = PyObject_GetAttr(__pyx_v_current, __pyx_n_s__prepend); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_res); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_res); __Pyx_GIVEREF(__pyx_v_res); __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7; } __pyx_L7:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":600 * if res is not None: * current.prepend(res) * child = child.prev # <<<<<<<<<<<<<< * return current * */ __pyx_v_child = __pyx_v_child->prev; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":601 * current.prepend(res) * child = child.prev * return current # <<<<<<<<<<<<<< * * ### KILL STUFF ### */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_current); __pyx_r = __pyx_v_current; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("codetalker.cgrammar.convert_back_ptree"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_current); __Pyx_DECREF(__pyx_v_res); __Pyx_XGIVEREF(__pyx_r); __Pyx_TraceReturn(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":605 * ### KILL STUFF ### * * cdef void kill_tokens(Token* start): # <<<<<<<<<<<<<< * cdef Token* tmp * while start != NULL: */ static void __pyx_f_10codetalker_8cgrammar_kill_tokens(struct Token *__pyx_v_start) { struct Token *__pyx_v_tmp; int __pyx_t_1; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("kill_tokens"); __Pyx_TraceCall("kill_tokens", __pyx_f[0], 605); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":607 * cdef void kill_tokens(Token* start): * cdef Token* tmp * while start != NULL: # <<<<<<<<<<<<<< * tmp = start * start = start.next */ while (1) { __pyx_t_1 = (__pyx_v_start != NULL); if (!__pyx_t_1) break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":608 * cdef Token* tmp * while start != NULL: * tmp = start # <<<<<<<<<<<<<< * start = start.next * free(tmp) */ __pyx_v_tmp = __pyx_v_start; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":609 * while start != NULL: * tmp = start * start = start.next # <<<<<<<<<<<<<< * free(tmp) * */ __pyx_v_start = __pyx_v_start->next; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":610 * tmp = start * start = start.next * free(tmp) # <<<<<<<<<<<<<< * * cdef void kill_ptree(cParseNode* node): */ free(__pyx_v_tmp); } __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":612 * free(tmp) * * cdef void kill_ptree(cParseNode* node): # <<<<<<<<<<<<<< * _kill_ptree(node) * */ static void __pyx_f_10codetalker_8cgrammar_kill_ptree(struct cParseNode *__pyx_v_node) { __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("kill_ptree"); __Pyx_TraceCall("kill_ptree", __pyx_f[0], 612); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":613 * * cdef void kill_ptree(cParseNode* node): * _kill_ptree(node) # <<<<<<<<<<<<<< * * ### TOKENIZE ### */ _kill_ptree(__pyx_v_node); __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":632 * int num * * cdef Token* _get_tokens(int gid, char* text, cTokenError* error, char* idchars): # <<<<<<<<<<<<<< * tokens = python_data[gid][1] * cdef: */ static struct Token *__pyx_f_10codetalker_8cgrammar__get_tokens(int __pyx_v_gid, char *__pyx_v_text, struct cTokenError *__pyx_v_error, char *__pyx_v_idchars) { PyObject *__pyx_v_tokens; struct Token *__pyx_v_start; struct Token *__pyx_v_current; struct Token *__pyx_v_tmp; struct __pyx_t_10codetalker_8cgrammar_TokenState __pyx_v_state; int __pyx_v_res; int __pyx_v_num; int __pyx_v_ntokens; int __pyx_v_indent; PyObject *__pyx_v_ID_t; PyObject *__pyx_v_DD_t; int __pyx_v_nstrs; PyObject *__pyx_v_i; struct __pyx_t_10codetalker_8cgrammar_cache_one *__pyx_v_str_cache; int __pyx_v_at; PyObject *__pyx_v_singles; PyObject *__pyx_v_m; struct Token *__pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; size_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; long __pyx_t_8; int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; long __pyx_t_12; char *__pyx_t_13; Py_ssize_t __pyx_t_14; unsigned int __pyx_t_15; int __pyx_t_16; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("_get_tokens"); __Pyx_TraceCall("_get_tokens", __pyx_f[0], 632); __pyx_v_tokens = Py_None; __Pyx_INCREF(Py_None); __pyx_v_ID_t = Py_None; __Pyx_INCREF(Py_None); __pyx_v_DD_t = Py_None; __Pyx_INCREF(Py_None); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); __pyx_v_singles = Py_None; __Pyx_INCREF(Py_None); __pyx_v_m = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":633 * * cdef Token* _get_tokens(int gid, char* text, cTokenError* error, char* idchars): * tokens = python_data[gid][1] # <<<<<<<<<<<<<< * cdef: * Token* start = NULL */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_tokens); __pyx_v_tokens = __pyx_t_1; __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":635 * tokens = python_data[gid][1] * cdef: * Token* start = NULL # <<<<<<<<<<<<<< * Token* current = NULL * Token* tmp = NULL */ __pyx_v_start = NULL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":636 * cdef: * Token* start = NULL * Token* current = NULL # <<<<<<<<<<<<<< * Token* tmp = NULL * */ __pyx_v_current = NULL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":637 * Token* start = NULL * Token* current = NULL * Token* tmp = NULL # <<<<<<<<<<<<<< * * TokenState state */ __pyx_v_tmp = NULL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":641 * TokenState state * * int res = 0 # <<<<<<<<<<<<<< * int num = 0 * int ntokens = len(tokens) - 3 # ignore INDENT, DEDENT, EOF */ __pyx_v_res = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":642 * * int res = 0 * int num = 0 # <<<<<<<<<<<<<< * int ntokens = len(tokens) - 3 # ignore INDENT, DEDENT, EOF * # char** strings = NULL */ __pyx_v_num = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":643 * int res = 0 * int num = 0 * int ntokens = len(tokens) - 3 # ignore INDENT, DEDENT, EOF # <<<<<<<<<<<<<< * # char** strings = NULL * bint indent = python_data[gid][2] */ __pyx_t_3 = PyObject_Length(__pyx_v_tokens); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ntokens = (__pyx_t_3 - 3); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":645 * int ntokens = len(tokens) - 3 # ignore INDENT, DEDENT, EOF * # char** strings = NULL * bint indent = python_data[gid][2] # <<<<<<<<<<<<<< * * state.at = 0 */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_indent = __pyx_t_4; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":647 * bint indent = python_data[gid][2] * * state.at = 0 # <<<<<<<<<<<<<< * state.text = text * state.ln = len(text) */ __pyx_v_state.at = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":648 * * state.at = 0 * state.text = text # <<<<<<<<<<<<<< * state.ln = len(text) * state.lineno = 1 */ __pyx_v_state.text = __pyx_v_text; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":649 * state.at = 0 * state.text = text * state.ln = len(text) # <<<<<<<<<<<<<< * state.lineno = 1 * state.charno = 1 */ __pyx_t_5 = strlen(__pyx_v_text); __pyx_v_state.ln = __pyx_t_5; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":650 * state.text = text * state.ln = len(text) * state.lineno = 1 # <<<<<<<<<<<<<< * state.charno = 1 * */ __pyx_v_state.lineno = 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":651 * state.ln = len(text) * state.lineno = 1 * state.charno = 1 # <<<<<<<<<<<<<< * * state.num_indents = 1 */ __pyx_v_state.charno = 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":653 * state.charno = 1 * * state.num_indents = 1 # <<<<<<<<<<<<<< * state.indents = malloc(sizeof(int)*100) * state.indents[0] = 0 */ __pyx_v_state.num_indents = 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":654 * * state.num_indents = 1 * state.indents = malloc(sizeof(int)*100) # <<<<<<<<<<<<<< * state.indents[0] = 0 * state.max_indents = 100 */ __pyx_v_state.indents = ((int *)malloc(((sizeof(int)) * 100))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":655 * state.num_indents = 1 * state.indents = malloc(sizeof(int)*100) * state.indents[0] = 0 # <<<<<<<<<<<<<< * state.max_indents = 100 * */ (__pyx_v_state.indents[0]) = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":656 * state.indents = malloc(sizeof(int)*100) * state.indents[0] = 0 * state.max_indents = 100 # <<<<<<<<<<<<<< * * ID_t = tokens.index(INDENT) */ __pyx_v_state.max_indents = 100; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":658 * state.max_indents = 100 * * ID_t = tokens.index(INDENT) # <<<<<<<<<<<<<< * DD_t = tokens.index(DEDENT) * */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_tokens, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__INDENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_ID_t); __pyx_v_ID_t = __pyx_t_2; __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":659 * * ID_t = tokens.index(INDENT) * DD_t = tokens.index(DEDENT) # <<<<<<<<<<<<<< * * ## a bit of JIT caching -- should be moved out of here, */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_tokens, __pyx_n_s__index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DEDENT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_DD_t); __pyx_v_DD_t = __pyx_t_6; __pyx_t_6 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":663 * ## a bit of JIT caching -- should be moved out of here, * ## but this is good enough for now * cdef int nstrs = 0 # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(cache_one)*nstrs); # <<<<<<<<<<<<<< * cdef int at = 0 * for i from 0<=imalloc(sizeof(cache_one)*nstrs); * cdef int at = 0 # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(cache_one)*nstrs); * cdef int at = 0 * for i from 0<=imalloc(sizeof(char*)*num) */ __pyx_t_6 = PyObject_GetItem(__pyx_v_tokens, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_num = __pyx_t_3; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":675 * tokens[i]._str_cid = at * num = len(tokens[i].strings) * str_cache[at].num = num # <<<<<<<<<<<<<< * str_cache[at].strings = malloc(sizeof(char*)*num) * singles = '' */ (__pyx_v_str_cache[__pyx_v_at]).num = __pyx_v_num; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":676 * num = len(tokens[i].strings) * str_cache[at].num = num * str_cache[at].strings = malloc(sizeof(char*)*num) # <<<<<<<<<<<<<< * singles = '' * for m from 0<=mmalloc(sizeof(char*)*num) * singles = '' # <<<<<<<<<<<<<< * for m from 0<=mmalloc(sizeof(char*)*num) * singles = '' * for m from 0<=mmalloc(sizeof(char)*(len(tokens[i].strings[m])+1)) */ __pyx_t_6 = PyObject_GetItem(__pyx_v_tokens, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyObject_GetItem(__pyx_t_2, __pyx_v_m); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_singles, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_singles); __pyx_v_singles = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L11; } __pyx_L11:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":681 * if tokens[i].strings[m][0] not in singles: * singles += tokens[i].strings[m][0] * str_cache[at].strings[m] = tokens[i].strings[m] # <<<<<<<<<<<<<< * # malloc(sizeof(char)*(len(tokens[i].strings[m])+1)) * # strcpy(str_cache[at].strings[m], tokens[i].strings[m]) */ __pyx_t_6 = PyObject_GetItem(__pyx_v_tokens, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyObject_GetItem(__pyx_t_2, __pyx_v_m); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = __Pyx_PyBytes_AsString(__pyx_t_6); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((__pyx_v_str_cache[__pyx_v_at]).strings[__pyx_t_3]) = __pyx_t_13; __pyx_t_12 = __Pyx_PyInt_AsLong(__pyx_v_m); if (unlikely((__pyx_t_12 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":678 * str_cache[at].strings = malloc(sizeof(char*)*num) * singles = '' * for m from 0<=mmalloc(sizeof(cache_one)*nstrs); * cdef int at = 0 * for i from 0<=imalloc(sizeof(Token)) * tmp.value = malloc(sizeof(char)*(res+1)) */ __pyx_t_11 = __pyx_v_res; if (__pyx_t_11) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":719 * * if res: * tmp = malloc(sizeof(Token)) # <<<<<<<<<<<<<< * tmp.value = malloc(sizeof(char)*(res+1)) * strncpy(tmp.value, state.text + state.at, res) */ __pyx_v_tmp = ((struct Token *)malloc((sizeof(struct Token)))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":720 * if res: * tmp = malloc(sizeof(Token)) * tmp.value = malloc(sizeof(char)*(res+1)) # <<<<<<<<<<<<<< * strncpy(tmp.value, state.text + state.at, res) * tmp.value[res] = '\0' */ __pyx_v_tmp->value = ((char *)malloc(((sizeof(char)) * (__pyx_v_res + 1)))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":721 * tmp = malloc(sizeof(Token)) * tmp.value = malloc(sizeof(char)*(res+1)) * strncpy(tmp.value, state.text + state.at, res) # <<<<<<<<<<<<<< * tmp.value[res] = '\0' * # print 'got token!', res, state.at, [tmp.value], state.lineno, state.charno */ strncpy(__pyx_v_tmp->value, (__pyx_v_state.text + __pyx_v_state.at), __pyx_v_res); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":722 * tmp.value = malloc(sizeof(char)*(res+1)) * strncpy(tmp.value, state.text + state.at, res) * tmp.value[res] = '\0' # <<<<<<<<<<<<<< * # print 'got token!', res, state.at, [tmp.value], state.lineno, state.charno * tmp.which = i */ (__pyx_v_tmp->value[__pyx_v_res]) = '\x00'; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":724 * tmp.value[res] = '\0' * # print 'got token!', res, state.at, [tmp.value], state.lineno, state.charno * tmp.which = i # <<<<<<<<<<<<<< * tmp.next = NULL * tmp.lineno = state.lineno */ __pyx_t_15 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_i); if (unlikely((__pyx_t_15 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tmp->which = __pyx_t_15; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":725 * # print 'got token!', res, state.at, [tmp.value], state.lineno, state.charno * tmp.which = i * tmp.next = NULL # <<<<<<<<<<<<<< * tmp.lineno = state.lineno * tmp.charno = state.charno */ __pyx_v_tmp->next = NULL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":726 * tmp.which = i * tmp.next = NULL * tmp.lineno = state.lineno # <<<<<<<<<<<<<< * tmp.charno = state.charno * if start == NULL: */ __pyx_v_tmp->lineno = __pyx_v_state.lineno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":727 * tmp.next = NULL * tmp.lineno = state.lineno * tmp.charno = state.charno # <<<<<<<<<<<<<< * if start == NULL: * start = tmp */ __pyx_v_tmp->charno = __pyx_v_state.charno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":728 * tmp.lineno = state.lineno * tmp.charno = state.charno * if start == NULL: # <<<<<<<<<<<<<< * start = tmp * else: */ __pyx_t_4 = (__pyx_v_start == NULL); if (__pyx_t_4) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":729 * tmp.charno = state.charno * if start == NULL: * start = tmp # <<<<<<<<<<<<<< * else: * current.next = tmp */ __pyx_v_start = __pyx_v_tmp; goto __pyx_L21; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":731 * start = tmp * else: * current.next = tmp # <<<<<<<<<<<<<< * current = tmp * */ __pyx_v_current->next = __pyx_v_tmp; } __pyx_L21:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":732 * else: * current.next = tmp * current = tmp # <<<<<<<<<<<<<< * * current = advance(res, current, indent, &state, ID_t, DD_t, error) */ __pyx_v_current = __pyx_v_tmp; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":734 * current = tmp * * current = advance(res, current, indent, &state, ID_t, DD_t, error) # <<<<<<<<<<<<<< * if current == NULL: * return NULL */ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_ID_t); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_v_DD_t); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_current = __pyx_f_10codetalker_8cgrammar_advance(__pyx_v_res, __pyx_v_current, __pyx_v_indent, (&__pyx_v_state), __pyx_t_11, __pyx_t_16, __pyx_v_error); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":735 * * current = advance(res, current, indent, &state, ID_t, DD_t, error) * if current == NULL: # <<<<<<<<<<<<<< * return NULL * state.at += res */ __pyx_t_4 = (__pyx_v_current == NULL); if (__pyx_t_4) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":736 * current = advance(res, current, indent, &state, ID_t, DD_t, error) * if current == NULL: * return NULL # <<<<<<<<<<<<<< * state.at += res * break */ __pyx_r = NULL; goto __pyx_L0; goto __pyx_L22; } __pyx_L22:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":737 * if current == NULL: * return NULL * state.at += res # <<<<<<<<<<<<<< * break * else: */ __pyx_v_state.at += __pyx_v_res; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":738 * return NULL * state.at += res * break # <<<<<<<<<<<<<< * else: * error.text = 'no valid token found' */ goto __pyx_L15_break; goto __pyx_L20; } __pyx_L20:; __pyx_t_8 = __Pyx_PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":689 * * while state.at < state.ln: * for i from 0<=itext = __pyx_k_19; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":741 * else: * error.text = 'no valid token found' * error.lineno = state.lineno # <<<<<<<<<<<<<< * error.charno = state.charno * return NULL */ __pyx_v_error->lineno = __pyx_v_state.lineno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":742 * error.text = 'no valid token found' * error.lineno = state.lineno * error.charno = state.charno # <<<<<<<<<<<<<< * return NULL * # print 'done tokenizing' */ __pyx_v_error->charno = __pyx_v_state.charno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":743 * error.lineno = state.lineno * error.charno = state.charno * return NULL # <<<<<<<<<<<<<< * # print 'done tokenizing' * return start */ __pyx_r = NULL; goto __pyx_L0; } __pyx_L15_break:; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":745 * return NULL * # print 'done tokenizing' * return start # <<<<<<<<<<<<<< * * cdef Token* advance(int res, Token* current, bint indent, TokenState* state, int ID_t, int DD_t, cTokenError* error): */ __pyx_r = __pyx_v_start; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_WriteUnraisable("codetalker.cgrammar._get_tokens"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_tokens); __Pyx_DECREF(__pyx_v_ID_t); __Pyx_DECREF(__pyx_v_DD_t); __Pyx_DECREF(__pyx_v_i); __Pyx_DECREF(__pyx_v_singles); __Pyx_DECREF(__pyx_v_m); __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":747 * return start * * cdef Token* advance(int res, Token* current, bint indent, TokenState* state, int ID_t, int DD_t, cTokenError* error): # <<<<<<<<<<<<<< * cdef: * int numlines = 0 */ static struct Token *__pyx_f_10codetalker_8cgrammar_advance(int __pyx_v_res, struct Token *__pyx_v_current, int __pyx_v_indent, struct __pyx_t_10codetalker_8cgrammar_TokenState *__pyx_v_state, int __pyx_v_ID_t, int __pyx_v_DD_t, struct cTokenError *__pyx_v_error) { int __pyx_v_numlines; int __pyx_v_cindent; int __pyx_v_last; int __pyx_v_ind; struct Token *__pyx_v_tmp; PyObject *__pyx_v_i; PyObject *__pyx_v_etxt; struct Token *__pyx_r; int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; char *__pyx_t_11; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("advance"); __Pyx_TraceCall("advance", __pyx_f[0], 747); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); __pyx_v_etxt = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":749 * cdef Token* advance(int res, Token* current, bint indent, TokenState* state, int ID_t, int DD_t, cTokenError* error): * cdef: * int numlines = 0 # <<<<<<<<<<<<<< * int cindent * int last = state.at */ __pyx_v_numlines = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":751 * int numlines = 0 * int cindent * int last = state.at # <<<<<<<<<<<<<< * int ind = 0 * Token* tmp */ __pyx_v_last = __pyx_v_state->at; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":752 * int cindent * int last = state.at * int ind = 0 # <<<<<<<<<<<<<< * Token* tmp * for i from state.at <= i < state.at + res: */ __pyx_v_ind = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":754 * int ind = 0 * Token* tmp * for i from state.at <= i < state.at + res: # <<<<<<<<<<<<<< * if state.text[i] == '\n': * numlines+=1 */ __pyx_t_1 = (__pyx_v_state->at + __pyx_v_res); for (__pyx_t_2 = __pyx_v_state->at; __pyx_t_2 < __pyx_t_1; __pyx_t_2++) { __pyx_t_3 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_3; __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":755 * Token* tmp * for i from state.at <= i < state.at + res: * if state.text[i] == '\n': # <<<<<<<<<<<<<< * numlines+=1 * last = i */ __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((__pyx_v_state->text[__pyx_t_4]) == '\n'); if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":756 * for i from state.at <= i < state.at + res: * if state.text[i] == '\n': * numlines+=1 # <<<<<<<<<<<<<< * last = i * state.lineno += numlines */ __pyx_v_numlines += 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":757 * if state.text[i] == '\n': * numlines+=1 * last = i # <<<<<<<<<<<<<< * state.lineno += numlines * if numlines: */ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_last = __pyx_t_6; goto __pyx_L5; } __pyx_L5:; __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":754 * int ind = 0 * Token* tmp * for i from state.at <= i < state.at + res: # <<<<<<<<<<<<<< * if state.text[i] == '\n': * numlines+=1 */ __pyx_t_3 = PyInt_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_3; __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":758 * numlines+=1 * last = i * state.lineno += numlines # <<<<<<<<<<<<<< * if numlines: * state.charno = state.at + res - last */ __pyx_v_state->lineno += __pyx_v_numlines; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":759 * last = i * state.lineno += numlines * if numlines: # <<<<<<<<<<<<<< * state.charno = state.at + res - last * else: */ __pyx_t_2 = __pyx_v_numlines; if (__pyx_t_2) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":760 * state.lineno += numlines * if numlines: * state.charno = state.at + res - last # <<<<<<<<<<<<<< * else: * state.charno += res */ __pyx_v_state->charno = ((__pyx_v_state->at + __pyx_v_res) - __pyx_v_last); goto __pyx_L6; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":762 * state.charno = state.at + res - last * else: * state.charno += res # <<<<<<<<<<<<<< * if not indent: * return current */ __pyx_v_state->charno += __pyx_v_res; } __pyx_L6:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":763 * else: * state.charno += res * if not indent: # <<<<<<<<<<<<<< * return current * ## TODO: check indent */ __pyx_t_5 = (!__pyx_v_indent); if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":764 * state.charno += res * if not indent: * return current # <<<<<<<<<<<<<< * ## TODO: check indent * if indent and res == 1 and state.text[state.at] == '\n': */ __pyx_r = __pyx_v_current; goto __pyx_L0; goto __pyx_L7; } __pyx_L7:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":766 * return current * ## TODO: check indent * if indent and res == 1 and state.text[state.at] == '\n': # <<<<<<<<<<<<<< * ind = t_white(state.at + 1, state.text, state.ln) * if ind < 0: */ if (__pyx_v_indent) { __pyx_t_5 = (__pyx_v_res == 1); if (__pyx_t_5) { __pyx_t_7 = ((__pyx_v_state->text[__pyx_v_state->at]) == ((char)'\n')); __pyx_t_8 = __pyx_t_7; } else { __pyx_t_8 = __pyx_t_5; } __pyx_t_5 = __pyx_t_8; } else { __pyx_t_5 = __pyx_v_indent; } if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":767 * ## TODO: check indent * if indent and res == 1 and state.text[state.at] == '\n': * ind = t_white(state.at + 1, state.text, state.ln) # <<<<<<<<<<<<<< * if ind < 0: * return current */ __pyx_v_ind = t_white((__pyx_v_state->at + 1), __pyx_v_state->text, __pyx_v_state->ln); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":768 * if indent and res == 1 and state.text[state.at] == '\n': * ind = t_white(state.at + 1, state.text, state.ln) * if ind < 0: # <<<<<<<<<<<<<< * return current * cindent = state.indents[state.num_indents - 1] */ __pyx_t_5 = (__pyx_v_ind < 0); if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":769 * ind = t_white(state.at + 1, state.text, state.ln) * if ind < 0: * return current # <<<<<<<<<<<<<< * cindent = state.indents[state.num_indents - 1] * if ind > cindent: */ __pyx_r = __pyx_v_current; goto __pyx_L0; goto __pyx_L9; } __pyx_L9:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":770 * if ind < 0: * return current * cindent = state.indents[state.num_indents - 1] # <<<<<<<<<<<<<< * if ind > cindent: * add_indent(state, ind) */ __pyx_v_cindent = (__pyx_v_state->indents[(__pyx_v_state->num_indents - 1)]); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":771 * return current * cindent = state.indents[state.num_indents - 1] * if ind > cindent: # <<<<<<<<<<<<<< * add_indent(state, ind) * tmp = malloc(sizeof(Token)) */ __pyx_t_5 = (__pyx_v_ind > __pyx_v_cindent); if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":772 * cindent = state.indents[state.num_indents - 1] * if ind > cindent: * add_indent(state, ind) # <<<<<<<<<<<<<< * tmp = malloc(sizeof(Token)) * tmp.value = '' */ __pyx_f_10codetalker_8cgrammar_add_indent(__pyx_v_state, __pyx_v_ind); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":773 * if ind > cindent: * add_indent(state, ind) * tmp = malloc(sizeof(Token)) # <<<<<<<<<<<<<< * tmp.value = '' * tmp.which = ID_t */ __pyx_v_tmp = ((struct Token *)malloc((sizeof(struct Token)))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":774 * add_indent(state, ind) * tmp = malloc(sizeof(Token)) * tmp.value = '' # <<<<<<<<<<<<<< * tmp.which = ID_t * tmp.next = NULL */ __pyx_v_tmp->value = __pyx_k_1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":775 * tmp = malloc(sizeof(Token)) * tmp.value = '' * tmp.which = ID_t # <<<<<<<<<<<<<< * tmp.next = NULL * tmp.lineno = state.lineno */ __pyx_v_tmp->which = __pyx_v_ID_t; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":776 * tmp.value = '' * tmp.which = ID_t * tmp.next = NULL # <<<<<<<<<<<<<< * tmp.lineno = state.lineno * tmp.charno = state.charno */ __pyx_v_tmp->next = NULL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":777 * tmp.which = ID_t * tmp.next = NULL * tmp.lineno = state.lineno # <<<<<<<<<<<<<< * tmp.charno = state.charno * current.next = tmp */ __pyx_v_tmp->lineno = __pyx_v_state->lineno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":778 * tmp.next = NULL * tmp.lineno = state.lineno * tmp.charno = state.charno # <<<<<<<<<<<<<< * current.next = tmp * current = tmp */ __pyx_v_tmp->charno = __pyx_v_state->charno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":779 * tmp.lineno = state.lineno * tmp.charno = state.charno * current.next = tmp # <<<<<<<<<<<<<< * current = tmp * elif ind < cindent: */ __pyx_v_current->next = __pyx_v_tmp; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":780 * tmp.charno = state.charno * current.next = tmp * current = tmp # <<<<<<<<<<<<<< * elif ind < cindent: * while ind < cindent: */ __pyx_v_current = __pyx_v_tmp; goto __pyx_L10; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":781 * current.next = tmp * current = tmp * elif ind < cindent: # <<<<<<<<<<<<<< * while ind < cindent: * state.num_indents -= 1 */ __pyx_t_5 = (__pyx_v_ind < __pyx_v_cindent); if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":782 * current = tmp * elif ind < cindent: * while ind < cindent: # <<<<<<<<<<<<<< * state.num_indents -= 1 * tmp = malloc(sizeof(Token)) */ while (1) { __pyx_t_5 = (__pyx_v_ind < __pyx_v_cindent); if (!__pyx_t_5) break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":783 * elif ind < cindent: * while ind < cindent: * state.num_indents -= 1 # <<<<<<<<<<<<<< * tmp = malloc(sizeof(Token)) * tmp.value = '' */ __pyx_v_state->num_indents -= 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":784 * while ind < cindent: * state.num_indents -= 1 * tmp = malloc(sizeof(Token)) # <<<<<<<<<<<<<< * tmp.value = '' * tmp.which = DD_t */ __pyx_v_tmp = ((struct Token *)malloc((sizeof(struct Token)))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":785 * state.num_indents -= 1 * tmp = malloc(sizeof(Token)) * tmp.value = '' # <<<<<<<<<<<<<< * tmp.which = DD_t * tmp.next = NULL */ __pyx_v_tmp->value = __pyx_k_1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":786 * tmp = malloc(sizeof(Token)) * tmp.value = '' * tmp.which = DD_t # <<<<<<<<<<<<<< * tmp.next = NULL * tmp.lineno = state.lineno */ __pyx_v_tmp->which = __pyx_v_DD_t; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":787 * tmp.value = '' * tmp.which = DD_t * tmp.next = NULL # <<<<<<<<<<<<<< * tmp.lineno = state.lineno * tmp.charno = state.charno */ __pyx_v_tmp->next = NULL; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":788 * tmp.which = DD_t * tmp.next = NULL * tmp.lineno = state.lineno # <<<<<<<<<<<<<< * tmp.charno = state.charno * current.next = tmp */ __pyx_v_tmp->lineno = __pyx_v_state->lineno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":789 * tmp.next = NULL * tmp.lineno = state.lineno * tmp.charno = state.charno # <<<<<<<<<<<<<< * current.next = tmp * current = tmp */ __pyx_v_tmp->charno = __pyx_v_state->charno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":790 * tmp.lineno = state.lineno * tmp.charno = state.charno * current.next = tmp # <<<<<<<<<<<<<< * current = tmp * cindent = state.indents[state.num_indents - 1] */ __pyx_v_current->next = __pyx_v_tmp; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":791 * tmp.charno = state.charno * current.next = tmp * current = tmp # <<<<<<<<<<<<<< * cindent = state.indents[state.num_indents - 1] * if ind != cindent: */ __pyx_v_current = __pyx_v_tmp; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":792 * current.next = tmp * current = tmp * cindent = state.indents[state.num_indents - 1] # <<<<<<<<<<<<<< * if ind != cindent: * etxt = 'invalid indentation -- %d (expected %d)' % (ind, cindent) */ __pyx_v_cindent = (__pyx_v_state->indents[(__pyx_v_state->num_indents - 1)]); } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":793 * current = tmp * cindent = state.indents[state.num_indents - 1] * if ind != cindent: # <<<<<<<<<<<<<< * etxt = 'invalid indentation -- %d (expected %d)' % (ind, cindent) * error.text = etxt */ __pyx_t_5 = (__pyx_v_ind != __pyx_v_cindent); if (__pyx_t_5) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":794 * cindent = state.indents[state.num_indents - 1] * if ind != cindent: * etxt = 'invalid indentation -- %d (expected %d)' % (ind, cindent) # <<<<<<<<<<<<<< * error.text = etxt * error.lineno = state.lineno */ __pyx_t_3 = PyInt_FromLong(__pyx_v_ind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = PyInt_FromLong(__pyx_v_cindent); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_3 = 0; __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_etxt); __pyx_v_etxt = __pyx_t_9; __pyx_t_9 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":795 * if ind != cindent: * etxt = 'invalid indentation -- %d (expected %d)' % (ind, cindent) * error.text = etxt # <<<<<<<<<<<<<< * error.lineno = state.lineno * error.charno = state.charno */ __pyx_t_11 = __Pyx_PyBytes_AsString(__pyx_v_etxt); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_error->text = __pyx_t_11; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":796 * etxt = 'invalid indentation -- %d (expected %d)' % (ind, cindent) * error.text = etxt * error.lineno = state.lineno # <<<<<<<<<<<<<< * error.charno = state.charno * return NULL */ __pyx_v_error->lineno = __pyx_v_state->lineno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":797 * error.text = etxt * error.lineno = state.lineno * error.charno = state.charno # <<<<<<<<<<<<<< * return NULL * return current */ __pyx_v_error->charno = __pyx_v_state->charno; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":798 * error.lineno = state.lineno * error.charno = state.charno * return NULL # <<<<<<<<<<<<<< * return current * */ __pyx_r = NULL; goto __pyx_L0; goto __pyx_L13; } __pyx_L13:; goto __pyx_L10; } __pyx_L10:; goto __pyx_L8; } __pyx_L8:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":799 * error.charno = state.charno * return NULL * return current # <<<<<<<<<<<<<< * * cdef void add_indent(TokenState* state, int ind): */ __pyx_r = __pyx_v_current; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_WriteUnraisable("codetalker.cgrammar.advance"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_i); __Pyx_DECREF(__pyx_v_etxt); __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":801 * return current * * cdef void add_indent(TokenState* state, int ind): # <<<<<<<<<<<<<< * cdef int* indents * if state.num_indents == state.max_indents: */ static void __pyx_f_10codetalker_8cgrammar_add_indent(struct __pyx_t_10codetalker_8cgrammar_TokenState *__pyx_v_state, int __pyx_v_ind) { int *__pyx_v_indents; PyObject *__pyx_v_i; int __pyx_t_1; int __pyx_t_2; long __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("add_indent"); __Pyx_TraceCall("add_indent", __pyx_f[0], 801); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":803 * cdef void add_indent(TokenState* state, int ind): * cdef int* indents * if state.num_indents == state.max_indents: # <<<<<<<<<<<<<< * indents = malloc(sizeof(int)*state.max_indents*2) * for i from 0<=inum_indents == __pyx_v_state->max_indents); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":804 * cdef int* indents * if state.num_indents == state.max_indents: * indents = malloc(sizeof(int)*state.max_indents*2) # <<<<<<<<<<<<<< * for i from 0<=imax_indents) * 2))); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":805 * if state.num_indents == state.max_indents: * indents = malloc(sizeof(int)*state.max_indents*2) * for i from 0<=imax_indents; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { __pyx_t_4 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_i); __pyx_v_i = __pyx_t_4; __pyx_t_4 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":806 * indents = malloc(sizeof(int)*state.max_indents*2) * for i from 0<=iindents[__pyx_t_5]); __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":805 * if state.num_indents == state.max_indents: * indents = malloc(sizeof(int)*state.max_indents*2) * for i from 0<=iindents); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":808 * indents[i] = state.indents[i] * free(state.indents) * state.indents = indents # <<<<<<<<<<<<<< * state.max_indents *= 2 * state.indents[state.num_indents] = ind */ __pyx_v_state->indents = __pyx_v_indents; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":809 * free(state.indents) * state.indents = indents * state.max_indents *= 2 # <<<<<<<<<<<<<< * state.indents[state.num_indents] = ind * state.num_indents += 1 */ __pyx_v_state->max_indents *= 2; goto __pyx_L3; } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":810 * state.indents = indents * state.max_indents *= 2 * state.indents[state.num_indents] = ind # <<<<<<<<<<<<<< * state.num_indents += 1 * */ (__pyx_v_state->indents[__pyx_v_state->num_indents]) = __pyx_v_ind; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":811 * state.max_indents *= 2 * state.indents[state.num_indents] = ind * state.num_indents += 1 # <<<<<<<<<<<<<< * * ### ASTTIZE ### */ __pyx_v_state->num_indents += 1; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("codetalker.cgrammar.add_indent"); __pyx_L0:; __Pyx_DECREF(__pyx_v_i); __Pyx_TraceReturn(Py_None); __Pyx_RefNannyFinishContext(); } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":815 * ### ASTTIZE ### * * cdef object _get_ast(Grammar* grammar, int gid, cParseNode* node, object ast_classes, object ast_tokens): # <<<<<<<<<<<<<< * # print 'getting ast' * if node == NULL: */ static PyObject *__pyx_f_10codetalker_8cgrammar__get_ast(struct Grammar *__pyx_v_grammar, int __pyx_v_gid, struct cParseNode *__pyx_v_node, PyObject *__pyx_v_ast_classes, PyObject *__pyx_v_ast_tokens) { struct AstAttrs __pyx_v_attrs; struct cParseNode *__pyx_v_child; struct cParseNode *__pyx_v_start; int __pyx_v_cnum; int __pyx_v_stepnum; PyObject *__pyx_v_name; PyObject *__pyx_v_res; PyObject *__pyx_v_obj; PyObject *__pyx_v_i; PyObject *__pyx_v_m; PyObject *__pyx_v_kids; PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; unsigned long __pyx_t_11; Py_ssize_t __pyx_t_12; unsigned int __pyx_t_13; unsigned long __pyx_t_14; Py_ssize_t __pyx_t_15; int __pyx_t_16; int __pyx_t_17; __Pyx_TraceDeclarations __Pyx_RefNannySetupContext("_get_ast"); __Pyx_TraceCall("_get_ast", __pyx_f[0], 815); __Pyx_INCREF(__pyx_v_ast_classes); __Pyx_INCREF(__pyx_v_ast_tokens); __pyx_v_name = Py_None; __Pyx_INCREF(Py_None); __pyx_v_res = Py_None; __Pyx_INCREF(Py_None); __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None); __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); __pyx_v_m = Py_None; __Pyx_INCREF(Py_None); __pyx_v_kids = Py_None; __Pyx_INCREF(Py_None); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":817 * cdef object _get_ast(Grammar* grammar, int gid, cParseNode* node, object ast_classes, object ast_tokens): * # print 'getting ast' * if node == NULL: # <<<<<<<<<<<<<< * return None * if node.type == NTOKEN: */ __pyx_t_1 = (__pyx_v_node == NULL); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":818 * # print 'getting ast' * if node == NULL: * return None # <<<<<<<<<<<<<< * if node.type == NTOKEN: * if node.token.value == NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":819 * if node == NULL: * return None * if node.type == NTOKEN: # <<<<<<<<<<<<<< * if node.token.value == NULL: * return None */ __pyx_t_1 = (__pyx_v_node->type == NTOKEN); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":820 * return None * if node.type == NTOKEN: * if node.token.value == NULL: # <<<<<<<<<<<<<< * return None * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) */ __pyx_t_1 = (__pyx_v_node->token->value == NULL); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":821 * if node.type == NTOKEN: * if node.token.value == NULL: * return None # <<<<<<<<<<<<<< * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) * cdef AstAttrs attrs = grammar.ast_attrs[node.rule] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L5; } __pyx_L5:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":822 * if node.token.value == NULL: * return None * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) # <<<<<<<<<<<<<< * cdef AstAttrs attrs = grammar.ast_attrs[node.rule] * cdef cParseNode* child */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_node->token->which, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_node->token->value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_node->token->lineno); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_node->token->charno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; goto __pyx_L4; } __pyx_L4:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":823 * return None * return python_data[gid][1][node.token.which](node.token.value, node.token.lineno, node.token.charno) * cdef AstAttrs attrs = grammar.ast_attrs[node.rule] # <<<<<<<<<<<<<< * cdef cParseNode* child * cdef cParseNode* start */ __pyx_v_attrs = (__pyx_v_grammar->ast_attrs[__pyx_v_node->rule]); /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":828 * cdef int cnum * cdef int stepnum * start = node.child # <<<<<<<<<<<<<< * while start.prev != NULL: * start.prev.next = start */ __pyx_v_start = __pyx_v_node->child; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":829 * cdef int stepnum * start = node.child * while start.prev != NULL: # <<<<<<<<<<<<<< * start.prev.next = start * start = start.prev */ while (1) { __pyx_t_1 = (__pyx_v_start->prev != NULL); if (!__pyx_t_1) break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":830 * start = node.child * while start.prev != NULL: * start.prev.next = start # <<<<<<<<<<<<<< * start = start.prev * */ __pyx_v_start->prev->next = __pyx_v_start; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":831 * while start.prev != NULL: * start.prev.next = start * start = start.prev # <<<<<<<<<<<<<< * * name = python_data[gid][0][node.rule] */ __pyx_v_start = __pyx_v_start->prev; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":833 * start = start.prev * * name = python_data[gid][0][node.rule] # <<<<<<<<<<<<<< * if attrs.pass_single: * # print 'pass single' */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__python_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_gid, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_node->rule, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_name); __pyx_v_name = __pyx_t_6; __pyx_t_6 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":834 * * name = python_data[gid][0][node.rule] * if attrs.pass_single: # <<<<<<<<<<<<<< * # print 'pass single' * child = start */ __pyx_t_7 = __pyx_v_attrs.pass_single; if (__pyx_t_7) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":836 * if attrs.pass_single: * # print 'pass single' * child = start # <<<<<<<<<<<<<< * while child != NULL: * if child.type != NTOKEN or child.token.which in ast_tokens: */ __pyx_v_child = __pyx_v_start; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":837 * # print 'pass single' * child = start * while child != NULL: # <<<<<<<<<<<<<< * if child.type != NTOKEN or child.token.which in ast_tokens: * return _get_ast(grammar, gid, child, ast_classes, ast_tokens) */ while (1) { __pyx_t_1 = (__pyx_v_child != NULL); if (!__pyx_t_1) break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":838 * child = start * while child != NULL: * if child.type != NTOKEN or child.token.which in ast_tokens: # <<<<<<<<<<<<<< * return _get_ast(grammar, gid, child, ast_classes, ast_tokens) * child = child.next */ __pyx_t_1 = (__pyx_v_child->type != NTOKEN); if (!__pyx_t_1) { __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_child->token->which); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = ((PySequence_Contains(__pyx_v_ast_tokens, __pyx_t_6))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __pyx_t_8; } else { __pyx_t_9 = __pyx_t_1; } if (__pyx_t_9) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":839 * while child != NULL: * if child.type != NTOKEN or child.token.which in ast_tokens: * return _get_ast(grammar, gid, child, ast_classes, ast_tokens) # <<<<<<<<<<<<<< * child = child.next * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_10codetalker_8cgrammar__get_ast(__pyx_v_grammar, __pyx_v_gid, __pyx_v_child, __pyx_v_ast_classes, __pyx_v_ast_tokens); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; goto __pyx_L11; } __pyx_L11:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":840 * if child.type != NTOKEN or child.token.which in ast_tokens: * return _get_ast(grammar, gid, child, ast_classes, ast_tokens) * child = child.next # <<<<<<<<<<<<<< * return None * elif not attrs.num: */ __pyx_v_child = __pyx_v_child->next; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":841 * return _get_ast(grammar, gid, child, ast_classes, ast_tokens) * child = child.next * return None # <<<<<<<<<<<<<< * elif not attrs.num: * # print 'pass multi' */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; goto __pyx_L8; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":842 * child = child.next * return None * elif not attrs.num: # <<<<<<<<<<<<<< * # print 'pass multi' * res = [] */ __pyx_t_9 = (!__pyx_v_attrs.num); if (__pyx_t_9) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":844 * elif not attrs.num: * # print 'pass multi' * res = [] # <<<<<<<<<<<<<< * child = start * while child != NULL: */ __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_DECREF(__pyx_v_res); __pyx_v_res = ((PyObject *)__pyx_t_6); __pyx_t_6 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":845 * # print 'pass multi' * res = [] * child = start # <<<<<<<<<<<<<< * while child != NULL: * if child.type != NTOKEN or child.token.which in ast_tokens: */ __pyx_v_child = __pyx_v_start; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":846 * res = [] * child = start * while child != NULL: # <<<<<<<<<<<<<< * if child.type != NTOKEN or child.token.which in ast_tokens: * res.append(_get_ast(grammar, gid, child, ast_classes, ast_tokens)) */ while (1) { __pyx_t_9 = (__pyx_v_child != NULL); if (!__pyx_t_9) break; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":847 * child = start * while child != NULL: * if child.type != NTOKEN or child.token.which in ast_tokens: # <<<<<<<<<<<<<< * res.append(_get_ast(grammar, gid, child, ast_classes, ast_tokens)) * child = child.next */ __pyx_t_9 = (__pyx_v_child->type != NTOKEN); if (!__pyx_t_9) { __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_child->token->which); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = ((PySequence_Contains(__pyx_v_ast_tokens, __pyx_t_6))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __pyx_t_1; } else { __pyx_t_8 = __pyx_t_9; } if (__pyx_t_8) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":848 * while child != NULL: * if child.type != NTOKEN or child.token.which in ast_tokens: * res.append(_get_ast(grammar, gid, child, ast_classes, ast_tokens)) # <<<<<<<<<<<<<< * child = child.next * return res */ __pyx_t_6 = __pyx_f_10codetalker_8cgrammar__get_ast(__pyx_v_grammar, __pyx_v_gid, __pyx_v_child, __pyx_v_ast_classes, __pyx_v_ast_tokens); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_res, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L14; } __pyx_L14:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":849 * if child.type != NTOKEN or child.token.which in ast_tokens: * res.append(_get_ast(grammar, gid, child, ast_classes, ast_tokens)) * child = child.next # <<<<<<<<<<<<<< * return res * */ __pyx_v_child = __pyx_v_child->next; } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":850 * res.append(_get_ast(grammar, gid, child, ast_classes, ast_tokens)) * child = child.next * return res # <<<<<<<<<<<<<< * * obj = getattr(ast_classes, name)() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_res); __pyx_r = __pyx_v_res; goto __pyx_L0; goto __pyx_L8; } __pyx_L8:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":852 * return res * * obj = getattr(ast_classes, name)() # <<<<<<<<<<<<<< * if grammar.rules.rules[node.rule].keep_tree: * obj._tree = convert_back_ptree(gid, node) */ __pyx_t_5 = PyObject_GetAttr(__pyx_v_ast_classes, __pyx_v_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_obj); __pyx_v_obj = __pyx_t_6; __pyx_t_6 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":853 * * obj = getattr(ast_classes, name)() * if grammar.rules.rules[node.rule].keep_tree: # <<<<<<<<<<<<<< * obj._tree = convert_back_ptree(gid, node) * */ __pyx_t_10 = (__pyx_v_grammar->rules.rules[__pyx_v_node->rule]).keep_tree; if (__pyx_t_10) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":854 * obj = getattr(ast_classes, name)() * if grammar.rules.rules[node.rule].keep_tree: * obj._tree = convert_back_ptree(gid, node) # <<<<<<<<<<<<<< * * for i from 0<=i= attrs.attrs[i].start: */ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = matches(__pyx_v_child, ((__pyx_v_attrs.attrs[__pyx_t_12]).types[__pyx_t_15])); if (__pyx_t_10) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":869 * if matches(child, attrs.attrs[i].types[m]): * # print 'match!' * if stepnum == 0 and cnum >= attrs.attrs[i].start: # <<<<<<<<<<<<<< * setattr(obj, attrs.attrs[i].name, _get_ast(grammar, gid, child, ast_classes, ast_tokens)) * break */ __pyx_t_8 = (__pyx_v_stepnum == 0); if (__pyx_t_8) { __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_v_cnum >= (__pyx_v_attrs.attrs[__pyx_t_15]).start); __pyx_t_1 = __pyx_t_9; } else { __pyx_t_1 = __pyx_t_8; } if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":870 * # print 'match!' * if stepnum == 0 and cnum >= attrs.attrs[i].start: * setattr(obj, attrs.attrs[i].name, _get_ast(grammar, gid, child, ast_classes, ast_tokens)) # <<<<<<<<<<<<<< * break * # print '(but not gotten)' */ __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyBytes_FromString((__pyx_v_attrs.attrs[__pyx_t_15]).name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __pyx_t_5 = __pyx_f_10codetalker_8cgrammar__get_ast(__pyx_v_grammar, __pyx_v_gid, __pyx_v_child, __pyx_v_ast_classes, __pyx_v_ast_tokens); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_16 = PyObject_SetAttr(__pyx_v_obj, ((PyObject *)__pyx_t_6), __pyx_t_5); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":871 * if stepnum == 0 and cnum >= attrs.attrs[i].start: * setattr(obj, attrs.attrs[i].name, _get_ast(grammar, gid, child, ast_classes, ast_tokens)) * break # <<<<<<<<<<<<<< * # print '(but not gotten)' * cnum += 1 */ goto __pyx_L22_break; goto __pyx_L24; } __pyx_L24:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":873 * break * # print '(but not gotten)' * cnum += 1 # <<<<<<<<<<<<<< * stepnum += 1 * if stepnum == attrs.attrs[i].step: */ __pyx_v_cnum += 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":874 * # print '(but not gotten)' * cnum += 1 * stepnum += 1 # <<<<<<<<<<<<<< * if stepnum == attrs.attrs[i].step: * stepnum = 0 */ __pyx_v_stepnum += 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":875 * cnum += 1 * stepnum += 1 * if stepnum == attrs.attrs[i].step: # <<<<<<<<<<<<<< * stepnum = 0 * else: */ __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_v_stepnum == (__pyx_v_attrs.attrs[__pyx_t_15]).step); if (__pyx_t_1) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":876 * stepnum += 1 * if stepnum == attrs.attrs[i].step: * stepnum = 0 # <<<<<<<<<<<<<< * else: * child = child.next */ __pyx_v_stepnum = 0; goto __pyx_L25; } __pyx_L25:; goto __pyx_L23; } __pyx_L23:; __pyx_t_14 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_m); if (unlikely((__pyx_t_14 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":866 * # print 'looking', attrs.attrs[i].numtypes * # print attrs.attrs[i].types[0] * for m from 0<=mnext; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":879 * else: * child = child.next * continue # <<<<<<<<<<<<<< * break * else: */ goto __pyx_L19_continue; } __pyx_L22_break:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":880 * child = child.next * continue * break # <<<<<<<<<<<<<< * else: * setattr(obj, attrs.attrs[i].name, None) */ goto __pyx_L20_break; __pyx_L19_continue:; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":882 * break * else: * setattr(obj, attrs.attrs[i].name, None) # <<<<<<<<<<<<<< * # raise AstError('No child nodes match astAttr %s' % attrs.attrs[i].name) * else: */ __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_attrs.attrs[__pyx_t_15]).name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __pyx_t_16 = PyObject_SetAttr(__pyx_v_obj, ((PyObject *)__pyx_t_5), Py_None); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; } __pyx_L20_break:; goto __pyx_L18; } /*else*/ { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":885 * # raise AstError('No child nodes match astAttr %s' % attrs.attrs[i].name) * else: * kids = [] # <<<<<<<<<<<<<< * setattr(obj, attrs.attrs[i].name, kids) * cnum = 0 */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(__pyx_v_kids); __pyx_v_kids = ((PyObject *)__pyx_t_5); __pyx_t_5 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":886 * else: * kids = [] * setattr(obj, attrs.attrs[i].name, kids) # <<<<<<<<<<<<<< * cnum = 0 * # print 'mtype' */ __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_attrs.attrs[__pyx_t_15]).name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __pyx_t_16 = PyObject_SetAttr(__pyx_v_obj, ((PyObject *)__pyx_t_5), __pyx_v_kids); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":887 * kids = [] * setattr(obj, attrs.attrs[i].name, kids) * cnum = 0 # <<<<<<<<<<<<<< * # print 'mtype' * while child != NULL: */ __pyx_v_cnum = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":889 * cnum = 0 * # print 'mtype' * while child != NULL: # <<<<<<<<<<<<<< * for m from 0<=m= attrs.attrs[i].start and (attrs.attrs[i].end == 0 or cnum < attrs.attrs[i].end): */ __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = matches(__pyx_v_child, ((__pyx_v_attrs.attrs[__pyx_t_15]).types[__pyx_t_12])); if (__pyx_t_10) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":893 * if matches(child, attrs.attrs[i].types[m]): * # print 'match!' * if cnum >= attrs.attrs[i].start and (attrs.attrs[i].end == 0 or cnum < attrs.attrs[i].end): # <<<<<<<<<<<<<< * kids.append(_get_ast(grammar, gid, child, ast_classes, ast_tokens)) * # else: */ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_v_cnum >= (__pyx_v_attrs.attrs[__pyx_t_12]).start); if (__pyx_t_1) { __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((__pyx_v_attrs.attrs[__pyx_t_12]).end == 0); if (!__pyx_t_8) { __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_v_cnum < (__pyx_v_attrs.attrs[__pyx_t_12]).end); __pyx_t_17 = __pyx_t_9; } else { __pyx_t_17 = __pyx_t_8; } __pyx_t_8 = __pyx_t_17; } else { __pyx_t_8 = __pyx_t_1; } if (__pyx_t_8) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":894 * # print 'match!' * if cnum >= attrs.attrs[i].start and (attrs.attrs[i].end == 0 or cnum < attrs.attrs[i].end): * kids.append(_get_ast(grammar, gid, child, ast_classes, ast_tokens)) # <<<<<<<<<<<<<< * # else: * # print '(but not gotten)' */ __pyx_t_5 = __pyx_f_10codetalker_8cgrammar__get_ast(__pyx_v_grammar, __pyx_v_gid, __pyx_v_child, __pyx_v_ast_classes, __pyx_v_ast_tokens); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_kids, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L31; } __pyx_L31:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":897 * # else: * # print '(but not gotten)' * cnum += 1 # <<<<<<<<<<<<<< * stepnum += 1 * if stepnum == attrs.attrs[i].step: */ __pyx_v_cnum += 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":898 * # print '(but not gotten)' * cnum += 1 * stepnum += 1 # <<<<<<<<<<<<<< * if stepnum == attrs.attrs[i].step: * stepnum = 0 */ __pyx_v_stepnum += 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":899 * cnum += 1 * stepnum += 1 * if stepnum == attrs.attrs[i].step: # <<<<<<<<<<<<<< * stepnum = 0 * break */ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = (__pyx_v_stepnum == (__pyx_v_attrs.attrs[__pyx_t_12]).step); if (__pyx_t_8) { /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":900 * stepnum += 1 * if stepnum == attrs.attrs[i].step: * stepnum = 0 # <<<<<<<<<<<<<< * break * child = child.next */ __pyx_v_stepnum = 0; goto __pyx_L32; } __pyx_L32:; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":901 * if stepnum == attrs.attrs[i].step: * stepnum = 0 * break # <<<<<<<<<<<<<< * child = child.next * # print 'got ast' */ goto __pyx_L29_break; goto __pyx_L30; } __pyx_L30:; __pyx_t_14 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_m); if (unlikely((__pyx_t_14 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":890 * # print 'mtype' * while child != NULL: * for m from 0<=mnext; } } __pyx_L18:; __pyx_t_11 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_i); if (unlikely((__pyx_t_11 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":856 * obj._tree = convert_back_ptree(gid, node) * * for i from 0<=i= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("cgrammar"), 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, {&__pyx_kp_u_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 1, 0, 0}, {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1}, {&__pyx_n_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 1}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, {&__pyx_n_s__ANY, __pyx_k__ANY, sizeof(__pyx_k__ANY), 0, 0, 1, 1}, {&__pyx_n_s__ANYCHAR, __pyx_k__ANYCHAR, sizeof(__pyx_k__ANYCHAR), 0, 0, 1, 1}, {&__pyx_n_s__AstError, __pyx_k__AstError, sizeof(__pyx_k__AstError), 0, 0, 1, 1}, {&__pyx_n_s__CCOMMENT, __pyx_k__CCOMMENT, sizeof(__pyx_k__CCOMMENT), 0, 0, 1, 1}, {&__pyx_n_s__CMCOMMENT, __pyx_k__CMCOMMENT, sizeof(__pyx_k__CMCOMMENT), 0, 0, 1, 1}, {&__pyx_n_s__CToken, __pyx_k__CToken, sizeof(__pyx_k__CToken), 0, 0, 1, 1}, {&__pyx_n_s__CharToken, __pyx_k__CharToken, sizeof(__pyx_k__CharToken), 0, 0, 1, 1}, {&__pyx_n_s__DEDENT, __pyx_k__DEDENT, sizeof(__pyx_k__DEDENT), 0, 0, 1, 1}, {&__pyx_n_s__EOF, __pyx_k__EOF, sizeof(__pyx_k__EOF), 0, 0, 1, 1}, {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1}, {&__pyx_n_s__HEX, __pyx_k__HEX, sizeof(__pyx_k__HEX), 0, 0, 1, 1}, {&__pyx_n_s__ID, __pyx_k__ID, sizeof(__pyx_k__ID), 0, 0, 1, 1}, {&__pyx_n_s__IIdToken, __pyx_k__IIdToken, sizeof(__pyx_k__IIdToken), 0, 0, 1, 1}, {&__pyx_n_s__INDENT, __pyx_k__INDENT, sizeof(__pyx_k__INDENT), 0, 0, 1, 1}, {&__pyx_n_s__INT, __pyx_k__INT, sizeof(__pyx_k__INT), 0, 0, 1, 1}, {&__pyx_n_s__IdToken, __pyx_k__IdToken, sizeof(__pyx_k__IdToken), 0, 0, 1, 1}, {&__pyx_n_s__NEWLINE, __pyx_k__NEWLINE, sizeof(__pyx_k__NEWLINE), 0, 0, 1, 1}, {&__pyx_n_s__NUMBER, __pyx_k__NUMBER, sizeof(__pyx_k__NUMBER), 0, 0, 1, 1}, {&__pyx_n_s__PYCOMMENT, __pyx_k__PYCOMMENT, sizeof(__pyx_k__PYCOMMENT), 0, 0, 1, 1}, {&__pyx_n_s__ParseError, __pyx_k__ParseError, sizeof(__pyx_k__ParseError), 0, 0, 1, 1}, {&__pyx_n_s__ParseNode, __pyx_k__ParseNode, sizeof(__pyx_k__ParseNode), 0, 0, 1, 1}, {&__pyx_n_s__PyToken, __pyx_k__PyToken, sizeof(__pyx_k__PyToken), 0, 0, 1, 1}, {&__pyx_n_s__ReToken, __pyx_k__ReToken, sizeof(__pyx_k__ReToken), 0, 0, 1, 1}, {&__pyx_n_s__SSTRING, __pyx_k__SSTRING, sizeof(__pyx_k__SSTRING), 0, 0, 1, 1}, {&__pyx_n_s__STRING, __pyx_k__STRING, sizeof(__pyx_k__STRING), 0, 0, 1, 1}, {&__pyx_n_s__StringToken, __pyx_k__StringToken, sizeof(__pyx_k__StringToken), 0, 0, 1, 1}, {&__pyx_n_s__TSTRING, __pyx_k__TSTRING, sizeof(__pyx_k__TSTRING), 0, 0, 1, 1}, {&__pyx_n_s__Token, __pyx_k__Token, sizeof(__pyx_k__Token), 0, 0, 1, 1}, {&__pyx_n_s__TokenError, __pyx_k__TokenError, sizeof(__pyx_k__TokenError), 0, 0, 1, 1}, {&__pyx_n_s__WHITE, __pyx_k__WHITE, sizeof(__pyx_k__WHITE), 0, 0, 1, 1}, {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1}, {&__pyx_n_s____repr__, __pyx_k____repr__, sizeof(__pyx_k____repr__), 0, 0, 1, 1}, {&__pyx_n_s____str__, __pyx_k____str__, sizeof(__pyx_k____str__), 0, 0, 1, 1}, {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, {&__pyx_n_s___str_cid, __pyx_k___str_cid, sizeof(__pyx_k___str_cid), 0, 0, 1, 1}, {&__pyx_n_s___tree, __pyx_k___tree, sizeof(__pyx_k___tree), 0, 0, 1, 1}, {&__pyx_n_s___type, __pyx_k___type, sizeof(__pyx_k___type), 0, 0, 1, 1}, {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, {&__pyx_n_s__ast_attrs, __pyx_k__ast_attrs, sizeof(__pyx_k__ast_attrs), 0, 0, 1, 1}, {&__pyx_n_s__ast_classes, __pyx_k__ast_classes, sizeof(__pyx_k__ast_classes), 0, 0, 1, 1}, {&__pyx_n_s__ast_tokens, __pyx_k__ast_tokens, sizeof(__pyx_k__ast_tokens), 0, 0, 1, 1}, {&__pyx_n_s__at, __pyx_k__at, sizeof(__pyx_k__at), 0, 0, 1, 1}, {&__pyx_n_s__attrs, __pyx_k__attrs, sizeof(__pyx_k__attrs), 0, 0, 1, 1}, {&__pyx_n_s__cache, __pyx_k__cache, sizeof(__pyx_k__cache), 0, 0, 1, 1}, {&__pyx_n_s__charno, __pyx_k__charno, sizeof(__pyx_k__charno), 0, 0, 1, 1}, {&__pyx_n_s__chars, __pyx_k__chars, sizeof(__pyx_k__chars), 0, 0, 1, 1}, {&__pyx_n_s__check, __pyx_k__check, sizeof(__pyx_k__check), 0, 0, 1, 1}, {&__pyx_n_s__child, __pyx_k__child, sizeof(__pyx_k__child), 0, 0, 1, 1}, {&__pyx_n_s__children, __pyx_k__children, sizeof(__pyx_k__children), 0, 0, 1, 1}, {&__pyx_n_s__dont_ignore, __pyx_k__dont_ignore, sizeof(__pyx_k__dont_ignore), 0, 0, 1, 1}, {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1}, {&__pyx_n_s__eof, __pyx_k__eof, sizeof(__pyx_k__eof), 0, 0, 1, 1}, {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1}, {&__pyx_n_s__getattr, __pyx_k__getattr, sizeof(__pyx_k__getattr), 0, 0, 1, 1}, {&__pyx_n_s__gid, __pyx_k__gid, sizeof(__pyx_k__gid), 0, 0, 1, 1}, {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1}, {&__pyx_n_s__idchars, __pyx_k__idchars, sizeof(__pyx_k__idchars), 0, 0, 1, 1}, {&__pyx_n_s__ignore, __pyx_k__ignore, sizeof(__pyx_k__ignore), 0, 0, 1, 1}, {&__pyx_n_s__indent, __pyx_k__indent, sizeof(__pyx_k__indent), 0, 0, 1, 1}, {&__pyx_n_s__indents, __pyx_k__indents, sizeof(__pyx_k__indents), 0, 0, 1, 1}, {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, {&__pyx_n_s__insert, __pyx_k__insert, sizeof(__pyx_k__insert), 0, 0, 1, 1}, {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1}, {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1}, {&__pyx_n_s__keep_tree, __pyx_k__keep_tree, sizeof(__pyx_k__keep_tree), 0, 0, 1, 1}, {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1}, {&__pyx_n_s__lineno, __pyx_k__lineno, sizeof(__pyx_k__lineno), 0, 0, 1, 1}, {&__pyx_n_s__ln, __pyx_k__ln, sizeof(__pyx_k__ln), 0, 0, 1, 1}, {&__pyx_n_s__max_indents, __pyx_k__max_indents, sizeof(__pyx_k__max_indents), 0, 0, 1, 1}, {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1}, {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1}, {&__pyx_n_s__num, __pyx_k__num, sizeof(__pyx_k__num), 0, 0, 1, 1}, {&__pyx_n_s__num_indents, __pyx_k__num_indents, sizeof(__pyx_k__num_indents), 0, 0, 1, 1}, {&__pyx_n_s__numtypes, __pyx_k__numtypes, sizeof(__pyx_k__numtypes), 0, 0, 1, 1}, {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1}, {&__pyx_n_s__option, __pyx_k__option, sizeof(__pyx_k__option), 0, 0, 1, 1}, {&__pyx_n_s__options, __pyx_k__options, sizeof(__pyx_k__options), 0, 0, 1, 1}, {&__pyx_n_s__parent, __pyx_k__parent, sizeof(__pyx_k__parent), 0, 0, 1, 1}, {&__pyx_n_s__pass_single, __pyx_k__pass_single, sizeof(__pyx_k__pass_single), 0, 0, 1, 1}, {&__pyx_n_s__prepend, __pyx_k__prepend, sizeof(__pyx_k__prepend), 0, 0, 1, 1}, {&__pyx_n_s__prev, __pyx_k__prev, sizeof(__pyx_k__prev), 0, 0, 1, 1}, {&__pyx_n_s__python_data, __pyx_k__python_data, sizeof(__pyx_k__python_data), 0, 0, 1, 1}, {&__pyx_n_s__reason, __pyx_k__reason, sizeof(__pyx_k__reason), 0, 0, 1, 1}, {&__pyx_n_s__rule, __pyx_k__rule, sizeof(__pyx_k__rule), 0, 0, 1, 1}, {&__pyx_n_s__rule_funcs, __pyx_k__rule_funcs, sizeof(__pyx_k__rule_funcs), 0, 0, 1, 1}, {&__pyx_n_s__rule_names, __pyx_k__rule_names, sizeof(__pyx_k__rule_names), 0, 0, 1, 1}, {&__pyx_n_s__rules, __pyx_k__rules, sizeof(__pyx_k__rules), 0, 0, 1, 1}, {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1}, {&__pyx_n_s__single, __pyx_k__single, sizeof(__pyx_k__single), 0, 0, 1, 1}, {&__pyx_n_s__special, __pyx_k__special, sizeof(__pyx_k__special), 0, 0, 1, 1}, {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1}, {&__pyx_n_s__start_i, __pyx_k__start_i, sizeof(__pyx_k__start_i), 0, 0, 1, 1}, {&__pyx_n_s__step, __pyx_k__step, sizeof(__pyx_k__step), 0, 0, 1, 1}, {&__pyx_n_s__strings, __pyx_k__strings, sizeof(__pyx_k__strings), 0, 0, 1, 1}, {&__pyx_n_s__text, __pyx_k__text, sizeof(__pyx_k__text), 0, 0, 1, 1}, {&__pyx_n_s__tid, __pyx_k__tid, sizeof(__pyx_k__tid), 0, 0, 1, 1}, {&__pyx_n_s__token, __pyx_k__token, sizeof(__pyx_k__token), 0, 0, 1, 1}, {&__pyx_n_s__tokens, __pyx_k__tokens, sizeof(__pyx_k__tokens), 0, 0, 1, 1}, {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1}, {&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1}, {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1}, {&__pyx_n_s__wanted, __pyx_k__wanted, sizeof(__pyx_k__wanted), 0, 0, 1, 1}, {&__pyx_n_s__which, __pyx_k__which, sizeof(__pyx_k__which), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_getattr = __Pyx_GetName(__pyx_b, __pyx_n_s__getattr); if (!__pyx_builtin_getattr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initcgrammar(void); /*proto*/ PyMODINIT_FUNC initcgrammar(void) #else PyMODINIT_FUNC PyInit_cgrammar(void); /*proto*/ PyMODINIT_FUNC PyInit_cgrammar(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_cgrammar(void)", __LINE__, __FILE__); #endif __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4(__Pyx_NAMESTR("cgrammar"), __pyx_methods, 0, 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #if PY_MAJOR_VERSION < 3 Py_INCREF(__pyx_m); #endif __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_module_is_main_codetalker__cgrammar) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":4 * from stdlib cimport malloc, free * * from codetalker.pgm.tokens import INDENT, DEDENT, EOF, Token as PyToken, ReToken # <<<<<<<<<<<<<< * from codetalker.pgm.errors import ParseError, TokenError, AstError * */ __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_n_s__INDENT)); PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__INDENT)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INDENT)); __Pyx_INCREF(((PyObject *)__pyx_n_s__DEDENT)); PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__DEDENT)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__DEDENT)); __Pyx_INCREF(((PyObject *)__pyx_n_s__EOF)); PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__EOF)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EOF)); __Pyx_INCREF(((PyObject *)__pyx_n_s__Token)); PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_s__Token)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Token)); __Pyx_INCREF(((PyObject *)__pyx_n_s__ReToken)); PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_s__ReToken)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ReToken)); __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_21), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__INDENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__INDENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DEDENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DEDENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__EOF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EOF, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Token); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PyToken, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ReToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ReToken, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":5 * * from codetalker.pgm.tokens import INDENT, DEDENT, EOF, Token as PyToken, ReToken * from codetalker.pgm.errors import ParseError, TokenError, AstError # <<<<<<<<<<<<<< * * '''Stuff in here: */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(((PyObject *)__pyx_n_s__ParseError)); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__ParseError)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ParseError)); __Pyx_INCREF(((PyObject *)__pyx_n_s__TokenError)); PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__TokenError)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__TokenError)); __Pyx_INCREF(((PyObject *)__pyx_n_s__AstError)); PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_n_s__AstError)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__AstError)); __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_22), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ParseError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ParseError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__TokenError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TokenError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__AstError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__AstError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":206 * Token* c_get_tokens(Grammar* grammar, char* text, int indent, cTokenError* error) * * ReToken._type = RETOKEN # <<<<<<<<<<<<<< * * class CToken(PyToken): */ __pyx_t_1 = PyInt_FromLong(RETOKEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ReToken); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___type, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":208 * ReToken._type = RETOKEN * * class CToken(PyToken): # <<<<<<<<<<<<<< * _type = CTOKEN * */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__CToken, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":209 * * class CToken(PyToken): * _type = CTOKEN # <<<<<<<<<<<<<< * * class TSTRING(CToken): */ __pyx_t_3 = PyInt_FromLong(CTOKEN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s___type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__CToken, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":211 * _type = CTOKEN * * class TSTRING(CToken): # <<<<<<<<<<<<<< * tid = tTSTRING * class SSTRING(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__TSTRING, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":212 * * class TSTRING(CToken): * tid = tTSTRING # <<<<<<<<<<<<<< * class SSTRING(CToken): * tid = tSSTRING */ __pyx_t_3 = PyInt_FromLong(tTSTRING); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TSTRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":213 * class TSTRING(CToken): * tid = tTSTRING * class SSTRING(CToken): # <<<<<<<<<<<<<< * tid = tSSTRING * class STRING(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__SSTRING, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":214 * tid = tTSTRING * class SSTRING(CToken): * tid = tSSTRING # <<<<<<<<<<<<<< * class STRING(CToken): * tid = tSTRING */ __pyx_t_3 = PyInt_FromLong(tSSTRING); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__SSTRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":215 * class SSTRING(CToken): * tid = tSSTRING * class STRING(CToken): # <<<<<<<<<<<<<< * tid = tSTRING * class ID(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__STRING, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":216 * tid = tSSTRING * class STRING(CToken): * tid = tSTRING # <<<<<<<<<<<<<< * class ID(CToken): * tid = tID */ __pyx_t_3 = PyInt_FromLong(tSTRING); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__STRING, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":217 * class STRING(CToken): * tid = tSTRING * class ID(CToken): # <<<<<<<<<<<<<< * tid = tID * class NUMBER(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__ID, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":218 * tid = tSTRING * class ID(CToken): * tid = tID # <<<<<<<<<<<<<< * class NUMBER(CToken): * tid = tNUMBER */ __pyx_t_3 = PyInt_FromLong(tID); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ID, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":219 * class ID(CToken): * tid = tID * class NUMBER(CToken): # <<<<<<<<<<<<<< * tid = tNUMBER * class INT(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__NUMBER, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":220 * tid = tID * class NUMBER(CToken): * tid = tNUMBER # <<<<<<<<<<<<<< * class INT(CToken): * tid = tINT */ __pyx_t_3 = PyInt_FromLong(tNUMBER); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NUMBER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":221 * class NUMBER(CToken): * tid = tNUMBER * class INT(CToken): # <<<<<<<<<<<<<< * tid = tINT * class HEX(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__INT, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":222 * tid = tNUMBER * class INT(CToken): * tid = tINT # <<<<<<<<<<<<<< * class HEX(CToken): * tid = tHEX */ __pyx_t_3 = PyInt_FromLong(tINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__INT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":223 * class INT(CToken): * tid = tINT * class HEX(CToken): # <<<<<<<<<<<<<< * tid = tHEX * class CCOMMENT(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__HEX, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":224 * tid = tINT * class HEX(CToken): * tid = tHEX # <<<<<<<<<<<<<< * class CCOMMENT(CToken): * tid = tCCOMMENT */ __pyx_t_3 = PyInt_FromLong(tHEX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HEX, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":225 * class HEX(CToken): * tid = tHEX * class CCOMMENT(CToken): # <<<<<<<<<<<<<< * tid = tCCOMMENT * class CMCOMMENT(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__CCOMMENT, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":226 * tid = tHEX * class CCOMMENT(CToken): * tid = tCCOMMENT # <<<<<<<<<<<<<< * class CMCOMMENT(CToken): * tid = tCMCOMMENT */ __pyx_t_3 = PyInt_FromLong(tCCOMMENT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__CCOMMENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":227 * class CCOMMENT(CToken): * tid = tCCOMMENT * class CMCOMMENT(CToken): # <<<<<<<<<<<<<< * tid = tCMCOMMENT * class PYCOMMENT(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__CMCOMMENT, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":228 * tid = tCCOMMENT * class CMCOMMENT(CToken): * tid = tCMCOMMENT # <<<<<<<<<<<<<< * class PYCOMMENT(CToken): * tid = tPYCOMMENT */ __pyx_t_3 = PyInt_FromLong(tCMCOMMENT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__CMCOMMENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":229 * class CMCOMMENT(CToken): * tid = tCMCOMMENT * class PYCOMMENT(CToken): # <<<<<<<<<<<<<< * tid = tPYCOMMENT * class WHITE(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__PYCOMMENT, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":230 * tid = tCMCOMMENT * class PYCOMMENT(CToken): * tid = tPYCOMMENT # <<<<<<<<<<<<<< * class WHITE(CToken): * tid = tWHITE */ __pyx_t_3 = PyInt_FromLong(tPYCOMMENT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PYCOMMENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":231 * class PYCOMMENT(CToken): * tid = tPYCOMMENT * class WHITE(CToken): # <<<<<<<<<<<<<< * tid = tWHITE * class NEWLINE(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__WHITE, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":232 * tid = tPYCOMMENT * class WHITE(CToken): * tid = tWHITE # <<<<<<<<<<<<<< * class NEWLINE(CToken): * tid = tNEWLINE */ __pyx_t_3 = PyInt_FromLong(tWHITE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__WHITE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":233 * class WHITE(CToken): * tid = tWHITE * class NEWLINE(CToken): # <<<<<<<<<<<<<< * tid = tNEWLINE * class ANY(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__NEWLINE, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":234 * tid = tWHITE * class NEWLINE(CToken): * tid = tNEWLINE # <<<<<<<<<<<<<< * class ANY(CToken): * tid = tANY */ __pyx_t_3 = PyInt_FromLong(tNEWLINE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NEWLINE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":235 * class NEWLINE(CToken): * tid = tNEWLINE * class ANY(CToken): # <<<<<<<<<<<<<< * tid = tANY * class ANYCHAR(CToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__ANY, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":236 * tid = tNEWLINE * class ANY(CToken): * tid = tANY # <<<<<<<<<<<<<< * class ANYCHAR(CToken): * tid = tANY */ __pyx_t_3 = PyInt_FromLong(tANY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ANY, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":237 * class ANY(CToken): * tid = tANY * class ANYCHAR(CToken): # <<<<<<<<<<<<<< * tid = tANY * class CharToken(PyToken): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__ANYCHAR, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":238 * tid = tANY * class ANYCHAR(CToken): * tid = tANY # <<<<<<<<<<<<<< * class CharToken(PyToken): * _type = CHARTOKEN */ __pyx_t_3 = PyInt_FromLong(tANY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__tid, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ANYCHAR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":239 * class ANYCHAR(CToken): * tid = tANY * class CharToken(PyToken): # <<<<<<<<<<<<<< * _type = CHARTOKEN * chars = '' */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__CharToken, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":240 * tid = tANY * class CharToken(PyToken): * _type = CHARTOKEN # <<<<<<<<<<<<<< * chars = '' * */ __pyx_t_3 = PyInt_FromLong(CHARTOKEN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s___type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":241 * class CharToken(PyToken): * _type = CHARTOKEN * chars = '' # <<<<<<<<<<<<<< * * class StringToken(PyToken): */ if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__chars, ((PyObject *)__pyx_kp_s_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttr(__pyx_m, __pyx_n_s__CharToken, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":243 * chars = '' * * class StringToken(PyToken): # <<<<<<<<<<<<<< * _type = STRTOKEN * strings = [] */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__StringToken, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":244 * * class StringToken(PyToken): * _type = STRTOKEN # <<<<<<<<<<<<<< * strings = [] * */ __pyx_t_3 = PyInt_FromLong(STRTOKEN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s___type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":245 * class StringToken(PyToken): * _type = STRTOKEN * strings = [] # <<<<<<<<<<<<<< * * class IdToken(PyToken): */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__strings, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__StringToken, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":247 * strings = [] * * class IdToken(PyToken): # <<<<<<<<<<<<<< * _type = IDTOKEN * strings = [] */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__IdToken, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":248 * * class IdToken(PyToken): * _type = IDTOKEN # <<<<<<<<<<<<<< * strings = [] * */ __pyx_t_3 = PyInt_FromLong(IDTOKEN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s___type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":249 * class IdToken(PyToken): * _type = IDTOKEN * strings = [] # <<<<<<<<<<<<<< * * class IIdToken(PyToken): */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__strings, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__IdToken, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":251 * strings = [] * * class IIdToken(PyToken): # <<<<<<<<<<<<<< * _type = IIDTOKEN * strings = [] */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__PyToken); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_2), __pyx_n_s__IIdToken, "codetalker.cgrammar"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":252 * * class IIdToken(PyToken): * _type = IIDTOKEN # <<<<<<<<<<<<<< * strings = [] * */ __pyx_t_3 = PyInt_FromLong(IIDTOKEN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s___type, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":253 * class IIdToken(PyToken): * _type = IIDTOKEN * strings = [] # <<<<<<<<<<<<<< * * python_data = {} */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s__strings, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__IIdToken, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":255 * strings = [] * * python_data = {} # <<<<<<<<<<<<<< * * def consume_grammar(rules, ignore, indent, idchars, rule_names, rule_funcs, tokens, ast_attrs): */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__python_data, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":366 * * cdef Token NO_TOKEN * NO_TOKEN.lineno = 1 # <<<<<<<<<<<<<< * NO_TOKEN.charno = 0 * NO_TOKEN.value = '' */ __pyx_v_10codetalker_8cgrammar_NO_TOKEN.lineno = 1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":367 * cdef Token NO_TOKEN * NO_TOKEN.lineno = 1 * NO_TOKEN.charno = 0 # <<<<<<<<<<<<<< * NO_TOKEN.value = '' * NO_TOKEN.which = 0 */ __pyx_v_10codetalker_8cgrammar_NO_TOKEN.charno = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":368 * NO_TOKEN.lineno = 1 * NO_TOKEN.charno = 0 * NO_TOKEN.value = '' # <<<<<<<<<<<<<< * NO_TOKEN.which = 0 * */ __pyx_v_10codetalker_8cgrammar_NO_TOKEN.value = __pyx_k_1; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":369 * NO_TOKEN.charno = 0 * NO_TOKEN.value = '' * NO_TOKEN.which = 0 # <<<<<<<<<<<<<< * * cdef Token* get_last_token(TokenStream* tokens): */ __pyx_v_10codetalker_8cgrammar_NO_TOKEN.which = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":412 * return crule * * cdef RuleOption convert_option(object option, to_or=False): # <<<<<<<<<<<<<< * cdef RuleOption coption * coption.num = len(option) */ __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k_10 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":564 * return res * * class ParseNode(object): # <<<<<<<<<<<<<< * def __init__(self, rule, name): * self.rule = rule */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); __pyx_t_3 = __Pyx_CreateClass(__pyx_t_1, ((PyObject *)__pyx_t_2), __pyx_n_s__ParseNode, "codetalker.cgrammar"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":565 * * class ParseNode(object): * def __init__(self, rule, name): # <<<<<<<<<<<<<< * self.rule = rule * self.name = name */ __pyx_t_1 = PyCFunction_New(&__pyx_mdef_10codetalker_8cgrammar_9ParseNode___init__, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":571 * self.parent = None * * def append(self, child): # <<<<<<<<<<<<<< * self.children.append(child) * child.parent = self */ __pyx_t_4 = PyCFunction_New(&__pyx_mdef_10codetalker_8cgrammar_9ParseNode_append, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__append, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":575 * child.parent = self * * def prepend(self, child): # <<<<<<<<<<<<<< * self.children.insert(0, child) * child.parent = self */ __pyx_t_1 = PyCFunction_New(&__pyx_mdef_10codetalker_8cgrammar_9ParseNode_prepend, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__prepend, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":579 * child.parent = self * * def __str__(self): # <<<<<<<<<<<<<< * strs = [] * for child in self.children: */ __pyx_t_4 = PyCFunction_New(&__pyx_mdef_10codetalker_8cgrammar_9ParseNode___str__, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____str__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":585 * return ''.join(strs) * * def __repr__(self): # <<<<<<<<<<<<<< * return u'' % (self.name, self.rule, len(self.children), str(self)) * */ __pyx_t_1 = PyCFunction_New(&__pyx_mdef_10codetalker_8cgrammar_9ParseNode___repr__, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____repr__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ParseNode, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/jared/clone/codetalker/codetalker/cgrammar.pyx":1 * # cython: profile=True # <<<<<<<<<<<<<< * from stdlib cimport malloc, free * */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/stdlib.pxd":2 * * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< * void free(void *ptr) * void *malloc(size_t size) */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { __Pyx_AddTraceback("init codetalker.cgrammar"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init codetalker.cgrammar"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } static const char *__pyx_filenames[] = { "cgrammar.pyx", }; /* Runtime support code */ static void __pyx_init_filenames(void) { __pyx_f = __pyx_filenames; } #if CYTHON_PROFILE static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno) { if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) { if (*code == NULL) { *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno); if (*code == NULL) return 0; } *frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate*/ *code, /*PyCodeObject *code*/ PyModule_GetDict(__pyx_m), /*PyObject *globals*/ 0 /*PyObject *locals*/ ); if (*frame == NULL) return 0; } else { (*frame)->f_tstate = PyThreadState_GET(); } return PyThreadState_GET()->c_profilefunc(PyThreadState_GET()->c_profileobj, *frame, PyTrace_CALL, NULL) == 0; } static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyCodeObject *py_code = 0; #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); py_srcfile = PyString_FromString(srcfile); #else py_funcname = PyUnicode_FromString(funcname); py_srcfile = PyUnicode_FromString(srcfile); #endif if (!py_funcname | !py_srcfile) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ #if PY_MAJOR_VERSION >= 3 0, /*int kwonlyargcount,*/ #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ firstlineno, /*int firstlineno,*/ __pyx_empty_bytes /*PyObject *lnotab*/ ); bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return py_code; } #endif /* CYTHON_PROFILE */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AS_STRING(kw_name)); #endif } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *number, *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } number = (num_expected == 1) ? "" : "s"; PyErr_Format(PyExc_TypeError, #if PY_VERSION_HEX < 0x02050000 "%s() takes %s %d positional argument%s (%d given)", #else "%s() takes %s %zd positional argument%s (%zd given)", #endif func_name, more_or_less, num_expected, number, num_found); } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; } else { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { #else if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { #endif goto invalid_keyword_type; } else { for (name = first_kw_arg; *name; name++) { #if PY_MAJOR_VERSION >= 3 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && PyUnicode_Compare(**name, key) == 0) break; #else if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && _PyString_Eq(**name, key)) break; #endif } if (*name) { values[name-argnames] = value; } else { /* unexpected keyword found */ for (name=argnames; name != first_kw_arg; name++) { if (**name == key) goto arg_passed_twice; #if PY_MAJOR_VERSION >= 3 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; #else if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && _PyString_Eq(**name, key)) goto arg_passed_twice; #endif } if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } } } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, **name); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%s() got an unexpected keyword argument '%s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 "need more than %d value%s to unpack", (int)index, #else "need more than %zd value%s to unpack", index, #endif (index == 1) ? "" : "s"); } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { PyErr_SetString(PyExc_ValueError, "too many values to unpack"); } static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { PyObject *item; if (!(item = PyIter_Next(iter))) { if (!PyErr_Occurred()) { __Pyx_RaiseNeedMoreValuesError(index); } } return item; } static int __Pyx_EndUnpack(PyObject *iter) { PyObject *item; if ((item = PyIter_Next(iter))) { Py_DECREF(item); __Pyx_RaiseTooManyValuesError(); return -1; } else if (!PyErr_Occurred()) return 0; else return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); if (!__import__) goto bad; if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; module = PyObject_CallFunctionObjArgs(__import__, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { PyObject *result; result = PyObject_GetAttr(dict, name); if (!result) PyErr_SetObject(PyExc_NameError, name); return result; } static PyObject *__Pyx_CreateClass( PyObject *bases, PyObject *dict, PyObject *name, const char *modname) { PyObject *py_modname; PyObject *result = 0; #if PY_MAJOR_VERSION < 3 py_modname = PyString_FromString(modname); #else py_modname = PyUnicode_FromString(modname); #endif if (!py_modname) goto bad; if (PyDict_SetItemString(dict, "__module__", py_modname) < 0) goto bad; #if PY_MAJOR_VERSION < 3 result = PyClass_New(bases, dict, name); #else result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL); #endif bad: Py_XDECREF(py_modname); return result; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); /* First, check the traceback argument, replacing None with NULL. */ if (tb == Py_None) { Py_DECREF(tb); tb = 0; } else if (tb != NULL && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } /* Next, replace a missing value with None */ if (value == NULL) { value = Py_None; Py_INCREF(value); } #if PY_VERSION_HEX < 0x02050000 if (!PyClass_Check(type)) #else if (!PyType_Check(type)) #endif { /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } /* Normalize to raise , */ Py_DECREF(value); value = type; #if PY_VERSION_HEX < 0x02050000 if (PyInstance_Check(type)) { type = (PyObject*) ((PyInstanceObject*)type)->in_class; Py_INCREF(type); } else { type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } #endif } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else /* Python 3+ */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (!PyExceptionClass_Check(type)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } PyErr_SetObject(type, value); if (tb) { PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } } bad: return; } #endif #if PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); } return f; } static int __Pyx_Print(PyObject *arg_tuple, int newline) { PyObject *f; PyObject* v; int i; if (!(f = __Pyx_GetStdout())) return -1; for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { if (PyFile_SoftSpace(f, 1)) { if (PyFile_WriteString(" ", f) < 0) return -1; } v = PyTuple_GET_ITEM(arg_tuple, i); if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) return -1; if (PyString_Check(v)) { char *s = PyString_AsString(v); Py_ssize_t len = PyString_Size(v); if (len > 0 && isspace(Py_CHARMASK(s[len-1])) && s[len-1] != ' ') PyFile_SoftSpace(f, 0); } } if (newline) { if (PyFile_WriteString("\n", f) < 0) return -1; PyFile_SoftSpace(f, 0); } return 0; } #else /* Python 3 has a print function */ static int __Pyx_Print(PyObject *arg_tuple, int newline) { PyObject* kwargs = 0; PyObject* result = 0; PyObject* end_string; if (!__pyx_print) { __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); if (!__pyx_print) return -1; } if (!newline) { if (!__pyx_print_kwargs) { __pyx_print_kwargs = PyDict_New(); if (!__pyx_print_kwargs) return -1; end_string = PyUnicode_FromStringAndSize(" ", 1); if (!end_string) return -1; if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { Py_DECREF(end_string); return -1; } Py_DECREF(end_string); } kwargs = __pyx_print_kwargs; } result = PyObject_Call(__pyx_print, arg_tuple, kwargs); if (!result) return -1; Py_DECREF(result); return 0; } #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned char" : "value too large to convert to unsigned char"); } return (unsigned char)-1; } return (unsigned char)val; } return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); } static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { const unsigned short neg_one = (unsigned short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned short" : "value too large to convert to unsigned short"); } return (unsigned short)-1; } return (unsigned short)val; } return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); } static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { const unsigned int neg_one = (unsigned int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned int" : "value too large to convert to unsigned int"); } return (unsigned int)-1; } return (unsigned int)val; } return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); } static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { const char neg_one = (char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to char" : "value too large to convert to char"); } return (char)-1; } return (char)val; } return (char)__Pyx_PyInt_AsLong(x); } static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { const short neg_one = (short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to short" : "value too large to convert to short"); } return (short)-1; } return (short)val; } return (short)__Pyx_PyInt_AsLong(x); } static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { const int neg_one = (int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to int" : "value too large to convert to int"); } return (int)-1; } return (int)val; } return (int)__Pyx_PyInt_AsLong(x); } static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { const signed char neg_one = (signed char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed char" : "value too large to convert to signed char"); } return (signed char)-1; } return (signed char)val; } return (signed char)__Pyx_PyInt_AsSignedLong(x); } static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { const signed short neg_one = (signed short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed short" : "value too large to convert to signed short"); } return (signed short)-1; } return (signed short)val; } return (signed short)__Pyx_PyInt_AsSignedLong(x); } static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { const signed int neg_one = (signed int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed int" : "value too large to convert to signed int"); } return (signed int)-1; } return (signed int)val; } return (signed int)__Pyx_PyInt_AsSignedLong(x); } static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long)-1; } return (unsigned long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long)-1; } return PyLong_AsUnsignedLong(x); } else { return PyLong_AsLong(x); } } else { unsigned long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (unsigned long)-1; val = __Pyx_PyInt_AsUnsignedLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG)-1; } return (unsigned PY_LONG_LONG)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG)-1; } return PyLong_AsUnsignedLongLong(x); } else { return PyLong_AsLongLong(x); } } else { unsigned PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (unsigned PY_LONG_LONG)-1; val = __Pyx_PyInt_AsUnsignedLongLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { const long neg_one = (long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long)-1; } return (long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long)-1; } return PyLong_AsUnsignedLong(x); } else { return PyLong_AsLong(x); } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long)-1; val = __Pyx_PyInt_AsLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG)-1; } return (PY_LONG_LONG)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG)-1; } return PyLong_AsUnsignedLongLong(x); } else { return PyLong_AsLongLong(x); } } else { PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; val = __Pyx_PyInt_AsLongLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { const signed long neg_one = (signed long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed long"); return (signed long)-1; } return (signed long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed long"); return (signed long)-1; } return PyLong_AsUnsignedLong(x); } else { return PyLong_AsLong(x); } } else { signed long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (signed long)-1; val = __Pyx_PyInt_AsSignedLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed PY_LONG_LONG"); return (signed PY_LONG_LONG)-1; } return (signed PY_LONG_LONG)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed PY_LONG_LONG"); return (signed PY_LONG_LONG)-1; } return PyLong_AsUnsignedLongLong(x); } else { return PyLong_AsLongLong(x); } } else { signed PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (signed PY_LONG_LONG)-1; val = __Pyx_PyInt_AsSignedLongLong(tmp); Py_DECREF(tmp); return val; } } static void __Pyx_WriteUnraisable(const char *name) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } } #include "compile.h" #include "frameobject.h" #include "traceback.h" static void __Pyx_AddTraceback(const char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(__pyx_filename); #else py_srcfile = PyUnicode_FromString(__pyx_filename); #endif if (!py_srcfile) goto bad; if (__pyx_clineno) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ #if PY_MAJOR_VERSION >= 3 0, /*int kwonlyargcount,*/ #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ __pyx_empty_bytes /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = __pyx_lineno; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); Py_XDECREF(py_code); Py_XDECREF(py_frame); } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else /* Python 3+ has unicode identifiers */ if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { if (x == Py_True) return 1; else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_VERSION_HEX < 0x03000000 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_VERSION_HEX < 0x03000000 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%s__ returned non-%s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject* x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #if PY_VERSION_HEX < 0x02050000 if (ival <= LONG_MAX) return PyInt_FromLong((long)ival); else { unsigned char *bytes = (unsigned char *) &ival; int one = 1; int little = (int)*(unsigned char*)&one; return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); } #else return PyInt_FromSize_t(ival); #endif } static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { return (size_t)-1; } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t)-1; } return (size_t)val; } #endif /* Py_PYTHON_H */