diff --git a/kola/_helper.h b/kola/_helper.h index 39eda36..5224ca5 100644 --- a/kola/_helper.h +++ b/kola/_helper.h @@ -9,7 +9,7 @@ extern "C" { #endif -enum TokenSyn { +static enum TokenSyn { CMD=1, CMD_N, TEXT, LITERAL, STRING, NUM, NUM_H, NUM_B, NUM_F, CLN, CMA, SLP, SRP } TokenSyn; @@ -57,6 +57,10 @@ static const char* get_format(int code) { { case 1: ERR_MSG(unknown symbol '%s'); + case 2: + ERR_MSG(command '%s' not found); + case 3: + ERR_MSG(an error occured during handling command '%s'); case 10: ERR_MSG(end of line in incurrect place); case 28: @@ -80,42 +84,85 @@ static const char* get_format(int code) { #include "frameobject.h" // For Cython limiting, error setting function has to define here static void __inline kola_set_error(PyObject* exc_type, int errorno, - const char* filename, int lineno, char* text) + const char* filename, int lineno, const char* text) { PyErr_Format(exc_type, get_format(errorno), errorno, text); // add traceback in .kola file -#if PY_VERSION_HEX >= 0x03080000 - _PyTraceback_Add("", filename, lineno); -#else - PyCodeObject* code = NULL; - PyFrameObject* frame = NULL; - PyObject* globals = NULL; - PyObject *exc, *val, *tb; + #if PY_VERSION_HEX >= 0x03080000 + _PyTraceback_Add("", filename, lineno); + #else + PyCodeObject* code = NULL; + PyFrameObject* frame = NULL; + PyObject* globals = NULL; + PyObject *exc, *val, *tb; + + PyErr_Fetch(&exc, &val, &tb); + + globals = PyDict_New(); + if (!globals) goto end; + code = PyCode_NewEmpty(filename, "", lineno); + if (!code) goto end; + frame = PyFrame_New( + PyThreadState_Get(), + code, + globals, + NULL + ); + if (!frame) goto end; + + frame->f_lineno = lineno; + PyErr_Restore(exc, val, tb); + PyTraceBack_Here(frame); + + end: + Py_XDECREF(code); + Py_XDECREF(frame); + Py_XDECREF(globals); + #endif +} +static void __inline kola_set_errcause(PyObject* exc_type, int errorno, + const char* filename, int lineno, const char* text, PyObject* cause) +{ + PyErr_Format(exc_type, get_format(errorno), errorno, text); + + PyObject *exc, *val, *tb; PyErr_Fetch(&exc, &val, &tb); - - globals = PyDict_New(); - if (!globals) goto end; - code = PyCode_NewEmpty(filename, "", lineno); - if (!code) goto end; - frame = PyFrame_New( - PyThreadState_Get(), - code, - globals, - NULL - ); - if (!frame) goto end; - - frame->f_lineno = lineno; - PyErr_Restore(exc, val, tb); - PyTraceBack_Here(frame); - -end: - Py_XDECREF(code); - Py_XDECREF(frame); - Py_XDECREF(globals); -#endif + if (cause == Py_None) { + PyException_SetContext(val, NULL); + } else { + Py_INCREF(cause); + PyException_SetCause(val, cause); + } + #if PY_VERSION_HEX >= 0x03080000 + PyErr_Restore(exc, val, tb); + _PyTraceback_Add("", filename, lineno); + #else + PyCodeObject* code = NULL; + PyFrameObject* frame = NULL; + PyObject* globals = NULL; + globals = PyDict_New(); + if (!globals) goto end; + code = PyCode_NewEmpty(filename, "", lineno); + if (!code) goto end; + frame = PyFrame_New( + PyThreadState_Get(), + code, + globals, + NULL + ); + if (!frame) goto end; + + frame->f_lineno = lineno; + PyErr_Restore(exc, val, tb); + PyTraceBack_Here(frame); + + end: + Py_XDECREF(code); + Py_XDECREF(frame); + Py_XDECREF(globals); + #endif } #endif diff --git a/kola/_helper.pxd b/kola/_helper.pxd index f7f7ac7..d45e372 100644 --- a/kola/_helper.pxd +++ b/kola/_helper.pxd @@ -16,4 +16,5 @@ cdef extern from "_helper.h": SLP SRP const uint8_t yy_goto[7][8] - void kola_set_error(object exc_type, int errorno, const char* filename, int lineno, char* text) except * + void kola_set_error(object exc_type, int errorno, const char* filename, int lineno, const char* text) except * + void kola_set_errcause(object exc_type, int errorno, const char* filename, int lineno, const char* text, object cause) except * diff --git a/kola/klvm.py b/kola/klvm.py index e73fa81..d2b37e8 100644 --- a/kola/klvm.py +++ b/kola/klvm.py @@ -1,6 +1,4 @@ -from argparse import ArgumentParser -import sys -from typing import Any, Callable, Dict, List, Optional, Tuple, Union +from typing import Any, Callable, Dict, Set, Tuple, Union from types import MethodType from .lexer import BaseLexer, StringLexer, FileLexer from .parser import Parser @@ -24,10 +22,13 @@ class KoiLangMeta(type): """ Metaclass for KoiLang class """ - __command_field__: List[KoiLangCommand] + __command_field__: Set[KoiLangCommand] def __new__(cls, name: str, base: Tuple[type, ...], attr: Dict[str, Any]): - __command_field__ = [i for i in attr.values() if isinstance(i, KoiLangCommand)] + __command_field__ = {i for i in attr.values() if isinstance(i, KoiLangCommand)} + for i in base: + if isinstance(i, KoiLangMeta): + __command_field__.update(i.__command_field__) attr["__command_field__"] = __command_field__ return super().__new__(cls, name, base, attr) @@ -54,20 +55,20 @@ def parse(self, lexer: Union[BaseLexer, str]) -> None: Parser(lexer, self.command_set).exec_() def parse_file(self, path: str) -> None: - Parser(FileLexer(path), self.command_set).exec_() + self.parse(FileLexer(path)) def parse_command(self, cmd: str) -> None: - Parser(StringLexer(cmd, stat=1), self.command_set).exec_() + self.parse(StringLexer(cmd, stat=1)) def parse_args(self, args: str) -> Tuple[tuple, dict]: return Parser(StringLexer(args, stat=2), self.command_set).parse_args() -def kola_command(func: Callable) -> KoiLangCommand: +def kola_command(func: Callable[..., Any]) -> KoiLangCommand: return KoiLangCommand(func.__name__, func) -def kola_text(func: Callable) -> KoiLangCommand: +def kola_text(func: Callable[[Any, str], Any]) -> KoiLangCommand: return KoiLangCommand("@text", func) -def kola_number(func: Callable) -> KoiLangCommand: +def kola_number(func: Callable[..., Any]) -> KoiLangCommand: return KoiLangCommand("@number", func) \ No newline at end of file diff --git a/kola/parser.c b/kola/parser.c index 0817d8c..3c721fa 100644 --- a/kola/parser.c +++ b/kola/parser.c @@ -1781,16 +1781,6 @@ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif -/* PyUnicode_Unicode.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); - -/* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char); - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) @@ -1816,6 +1806,9 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); @@ -2302,14 +2295,12 @@ int __pyx_module_is_main_kola__parser = 0; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_StopIteration; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "'"; +static const char __pyx_k_[] = "."; static const char __pyx_k_n[] = "n"; -static const char __pyx_k__2[] = "."; static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k__16[] = "?"; +static const char __pyx_k__15[] = "?"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_None[] = "None"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_exec[] = "exec_"; static const char __pyx_k_main[] = "__main__"; @@ -2328,7 +2319,6 @@ static const char __pyx_k_number[] = "@number"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_update[] = "update"; -static const char __pyx_k_command[] = "command '"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_getstate[] = "__getstate__"; @@ -2337,7 +2327,6 @@ static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_exception[] = "exception"; static const char __pyx_k_exec_once[] = "exec_once"; static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_not_found[] = "' not found"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_Parser_pop[] = "Parser.pop"; @@ -2369,7 +2358,6 @@ static const char __pyx_k_pyx_unpickle_Parser[] = "__pyx_unpickle_Parser"; static const char __pyx_k_Parser___reduce_cython[] = "Parser.__reduce_cython__"; static const char __pyx_k_Parser___setstate_cython[] = "Parser.__setstate_cython__"; static const char __pyx_k_Incompatible_checksums_s_vs_0x26[] = "Incompatible checksums (%s vs 0x266c945 = (command_set, lexer, stack_top, stat, t_cache))"; -static const char __pyx_k_an_error_occured_during_handling[] = "an error occured during handling command '"; #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_kp_u_; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x26; @@ -2377,7 +2365,6 @@ static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_s_KoiLangCommandError; static PyObject *__pyx_n_s_KoiLangError; static PyObject *__pyx_n_s_KoiLangSyntaxError; -static PyObject *__pyx_kp_u_None; static PyObject *__pyx_n_s_Parser; static PyObject *__pyx_n_s_Parser___reduce_cython; static PyObject *__pyx_n_s_Parser___setstate_cython; @@ -2388,12 +2375,9 @@ static PyObject *__pyx_n_s_Parser_pop; static PyObject *__pyx_n_s_Parser_push; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_StopIteration; -static PyObject *__pyx_n_s__16; -static PyObject *__pyx_kp_u__2; -static PyObject *__pyx_kp_u_an_error_occured_during_handling; +static PyObject *__pyx_n_s__15; static PyObject *__pyx_n_s_asyncio_coroutines; static PyObject *__pyx_n_s_cline_in_traceback; -static PyObject *__pyx_kp_u_command; static PyObject *__pyx_n_s_command_set; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dict_2; @@ -2414,7 +2398,6 @@ static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_new; -static PyObject *__pyx_kp_u_not_found; static PyObject *__pyx_kp_u_number; static PyObject *__pyx_n_s_parse_args; static PyObject *__pyx_n_s_pickle; @@ -2460,19 +2443,19 @@ static PyObject *__pyx_tp_new_4kola_6parser_Parser(PyTypeObject *t, PyObject *a, static PyObject *__pyx_int_40290629; #endif #if !CYTHON_USE_MODULE_STATE -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__10; -static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__8; -static PyObject *__pyx_codeobj__9; -static PyObject *__pyx_codeobj__11; -static PyObject *__pyx_codeobj__13; -static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; #endif /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ @@ -2505,7 +2488,6 @@ typedef struct { PyObject *__pyx_n_s_KoiLangCommandError; PyObject *__pyx_n_s_KoiLangError; PyObject *__pyx_n_s_KoiLangSyntaxError; - PyObject *__pyx_kp_u_None; PyObject *__pyx_n_s_Parser; PyObject *__pyx_n_s_Parser___reduce_cython; PyObject *__pyx_n_s_Parser___setstate_cython; @@ -2516,12 +2498,9 @@ typedef struct { PyObject *__pyx_n_s_Parser_push; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_n_s_StopIteration; - PyObject *__pyx_n_s__16; - PyObject *__pyx_kp_u__2; - PyObject *__pyx_kp_u_an_error_occured_during_handling; + PyObject *__pyx_n_s__15; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_kp_u_command; PyObject *__pyx_n_s_command_set; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; @@ -2542,7 +2521,6 @@ typedef struct { PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_new; - PyObject *__pyx_kp_u_not_found; PyObject *__pyx_kp_u_number; PyObject *__pyx_n_s_parse_args; PyObject *__pyx_n_s_pickle; @@ -2568,19 +2546,19 @@ typedef struct { PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_int_40290629; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__10; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__14; - PyObject *__pyx_codeobj__4; + PyObject *__pyx_tuple__2; + PyObject *__pyx_tuple__4; + PyObject *__pyx_tuple__9; + PyObject *__pyx_tuple__11; + PyObject *__pyx_tuple__13; + PyObject *__pyx_codeobj__3; + PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__7; PyObject *__pyx_codeobj__8; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__15; + PyObject *__pyx_codeobj__10; + PyObject *__pyx_codeobj__12; + PyObject *__pyx_codeobj__14; } __pyx_mstate; #ifdef __cplusplus @@ -2629,7 +2607,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_KoiLangCommandError); Py_CLEAR(clear_module_state->__pyx_n_s_KoiLangError); Py_CLEAR(clear_module_state->__pyx_n_s_KoiLangSyntaxError); - Py_CLEAR(clear_module_state->__pyx_kp_u_None); Py_CLEAR(clear_module_state->__pyx_n_s_Parser); Py_CLEAR(clear_module_state->__pyx_n_s_Parser___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Parser___setstate_cython); @@ -2640,12 +2617,9 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Parser_push); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); - Py_CLEAR(clear_module_state->__pyx_n_s__16); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); - Py_CLEAR(clear_module_state->__pyx_kp_u_an_error_occured_during_handling); + Py_CLEAR(clear_module_state->__pyx_n_s__15); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_kp_u_command); Py_CLEAR(clear_module_state->__pyx_n_s_command_set); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); @@ -2666,7 +2640,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_new); - Py_CLEAR(clear_module_state->__pyx_kp_u_not_found); Py_CLEAR(clear_module_state->__pyx_kp_u_number); Py_CLEAR(clear_module_state->__pyx_n_s_parse_args); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); @@ -2692,19 +2665,19 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_int_40290629); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__10); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_tuple__2); + Py_CLEAR(clear_module_state->__pyx_tuple__4); + Py_CLEAR(clear_module_state->__pyx_tuple__9); + Py_CLEAR(clear_module_state->__pyx_tuple__11); + Py_CLEAR(clear_module_state->__pyx_tuple__13); + Py_CLEAR(clear_module_state->__pyx_codeobj__3); + Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__7); Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); + Py_CLEAR(clear_module_state->__pyx_codeobj__10); + Py_CLEAR(clear_module_state->__pyx_codeobj__12); + Py_CLEAR(clear_module_state->__pyx_codeobj__14); return 0; } #endif @@ -2740,7 +2713,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_KoiLangCommandError); Py_VISIT(traverse_module_state->__pyx_n_s_KoiLangError); Py_VISIT(traverse_module_state->__pyx_n_s_KoiLangSyntaxError); - Py_VISIT(traverse_module_state->__pyx_kp_u_None); Py_VISIT(traverse_module_state->__pyx_n_s_Parser); Py_VISIT(traverse_module_state->__pyx_n_s_Parser___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Parser___setstate_cython); @@ -2751,12 +2723,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Parser_push); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); - Py_VISIT(traverse_module_state->__pyx_n_s__16); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); - Py_VISIT(traverse_module_state->__pyx_kp_u_an_error_occured_during_handling); + Py_VISIT(traverse_module_state->__pyx_n_s__15); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_kp_u_command); Py_VISIT(traverse_module_state->__pyx_n_s_command_set); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); @@ -2777,7 +2746,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_new); - Py_VISIT(traverse_module_state->__pyx_kp_u_not_found); Py_VISIT(traverse_module_state->__pyx_kp_u_number); Py_VISIT(traverse_module_state->__pyx_n_s_parse_args); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); @@ -2803,19 +2771,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_int_40290629); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__10); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_tuple__2); + Py_VISIT(traverse_module_state->__pyx_tuple__4); + Py_VISIT(traverse_module_state->__pyx_tuple__9); + Py_VISIT(traverse_module_state->__pyx_tuple__11); + Py_VISIT(traverse_module_state->__pyx_tuple__13); + Py_VISIT(traverse_module_state->__pyx_codeobj__3); + Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__7); Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); + Py_VISIT(traverse_module_state->__pyx_codeobj__10); + Py_VISIT(traverse_module_state->__pyx_codeobj__12); + Py_VISIT(traverse_module_state->__pyx_codeobj__14); return 0; } #endif @@ -2848,7 +2816,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_KoiLangCommandError __pyx_mstate_global->__pyx_n_s_KoiLangCommandError #define __pyx_n_s_KoiLangError __pyx_mstate_global->__pyx_n_s_KoiLangError #define __pyx_n_s_KoiLangSyntaxError __pyx_mstate_global->__pyx_n_s_KoiLangSyntaxError -#define __pyx_kp_u_None __pyx_mstate_global->__pyx_kp_u_None #define __pyx_n_s_Parser __pyx_mstate_global->__pyx_n_s_Parser #define __pyx_n_s_Parser___reduce_cython __pyx_mstate_global->__pyx_n_s_Parser___reduce_cython #define __pyx_n_s_Parser___setstate_cython __pyx_mstate_global->__pyx_n_s_Parser___setstate_cython @@ -2859,12 +2826,9 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Parser_push __pyx_mstate_global->__pyx_n_s_Parser_push #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration -#define __pyx_n_s__16 __pyx_mstate_global->__pyx_n_s__16 -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 -#define __pyx_kp_u_an_error_occured_during_handling __pyx_mstate_global->__pyx_kp_u_an_error_occured_during_handling +#define __pyx_n_s__15 __pyx_mstate_global->__pyx_n_s__15 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_kp_u_command __pyx_mstate_global->__pyx_kp_u_command #define __pyx_n_s_command_set __pyx_mstate_global->__pyx_n_s_command_set #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 @@ -2885,7 +2849,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new -#define __pyx_kp_u_not_found __pyx_mstate_global->__pyx_kp_u_not_found #define __pyx_kp_u_number __pyx_mstate_global->__pyx_kp_u_number #define __pyx_n_s_parse_args __pyx_mstate_global->__pyx_n_s_parse_args #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle @@ -2911,19 +2874,19 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_int_40290629 __pyx_mstate_global->__pyx_int_40290629 -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 +#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 +#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 +#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 +#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 +#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 +#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 +#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 +#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 +#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #endif /* #### Code section: module_code ### */ @@ -3548,13 +3511,14 @@ static void __pyx_f_4kola_6parser_6Parser_set_error(struct __pyx_obj_4kola_6pars int __pyx_v_errorno = ((int)16); int __pyx_v_lineno; char const *__pyx_v_text; + struct __pyx_obj_4kola_5lexer_Token *__pyx_v_cur = 0; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - char *__pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -3570,7 +3534,7 @@ static void __pyx_f_4kola_6parser_6Parser_set_error(struct __pyx_obj_4kola_6pars * cdef: * int lineno = 1 # <<<<<<<<<<<<<< * const char* text = "" - * if not self.t_cache is None: + * Token cur = self.t_cache */ __pyx_v_lineno = 1; @@ -3578,142 +3542,154 @@ static void __pyx_f_4kola_6parser_6Parser_set_error(struct __pyx_obj_4kola_6pars * cdef: * int lineno = 1 * const char* text = "" # <<<<<<<<<<<<<< - * if not self.t_cache is None: - * lineno = self.t_cache.lineno + * Token cur = self.t_cache + * if not cur is None: */ __pyx_v_text = ((char const *)""); /* "kola/parser.pyx":24 * int lineno = 1 * const char* text = "" - * if not self.t_cache is None: # <<<<<<<<<<<<<< + * Token cur = self.t_cache # <<<<<<<<<<<<<< + * if not cur is None: * lineno = self.t_cache.lineno - * if errorno == 16: */ - __pyx_t_1 = (((PyObject *)__pyx_v_self->t_cache) != Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { + __pyx_t_1 = ((PyObject *)__pyx_v_self->t_cache); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_cur = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1); + __pyx_t_1 = 0; - /* "kola/parser.pyx":25 + /* "kola/parser.pyx":25 * const char* text = "" - * if not self.t_cache is None: - * lineno = self.t_cache.lineno # <<<<<<<<<<<<<< + * Token cur = self.t_cache + * if not cur is None: # <<<<<<<<<<<<<< + * lineno = self.t_cache.lineno * if errorno == 16: - * errorno = (self.stat << 4) + self.t_cache.syn */ - __pyx_t_3 = __pyx_v_self->t_cache->lineno; - __pyx_v_lineno = __pyx_t_3; + __pyx_t_2 = (((PyObject *)__pyx_v_cur) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { /* "kola/parser.pyx":26 - * if not self.t_cache is None: + * Token cur = self.t_cache + * if not cur is None: + * lineno = self.t_cache.lineno # <<<<<<<<<<<<<< + * if errorno == 16: + * errorno = (self.stat << 4) + cur.syn + */ + __pyx_t_4 = __pyx_v_self->t_cache->lineno; + __pyx_v_lineno = __pyx_t_4; + + /* "kola/parser.pyx":27 + * if not cur is None: * lineno = self.t_cache.lineno * if errorno == 16: # <<<<<<<<<<<<<< - * errorno = (self.stat << 4) + self.t_cache.syn - * text = self.t_cache.raw_val + * errorno = (self.stat << 4) + cur.syn + * text = cur.raw_val */ - __pyx_t_2 = ((__pyx_v_errorno == 16) != 0); - if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_errorno == 16) != 0); + if (__pyx_t_3) { - /* "kola/parser.pyx":27 + /* "kola/parser.pyx":28 * lineno = self.t_cache.lineno * if errorno == 16: - * errorno = (self.stat << 4) + self.t_cache.syn # <<<<<<<<<<<<<< - * text = self.t_cache.raw_val + * errorno = (self.stat << 4) + cur.syn # <<<<<<<<<<<<<< + * text = cur.raw_val * while not self.t_cache is None and not CMD <= self.t_cache.syn <= TEXT: */ - __pyx_v_errorno = ((__pyx_v_self->stat << 4) + __pyx_v_self->t_cache->syn); + __pyx_v_errorno = ((__pyx_v_self->stat << 4) + __pyx_v_cur->syn); - /* "kola/parser.pyx":26 - * if not self.t_cache is None: + /* "kola/parser.pyx":27 + * if not cur is None: * lineno = self.t_cache.lineno * if errorno == 16: # <<<<<<<<<<<<<< - * errorno = (self.stat << 4) + self.t_cache.syn - * text = self.t_cache.raw_val + * errorno = (self.stat << 4) + cur.syn + * text = cur.raw_val */ } - /* "kola/parser.pyx":28 + /* "kola/parser.pyx":29 * if errorno == 16: - * errorno = (self.stat << 4) + self.t_cache.syn - * text = self.t_cache.raw_val # <<<<<<<<<<<<<< + * errorno = (self.stat << 4) + cur.syn + * text = cur.raw_val # <<<<<<<<<<<<<< * while not self.t_cache is None and not CMD <= self.t_cache.syn <= TEXT: * self.t_cache = self.lexer.next_token() */ - if (unlikely(__pyx_v_self->t_cache->raw_val == Py_None)) { + if (unlikely(__pyx_v_cur->raw_val == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 28, __pyx_L1_error) + __PYX_ERR(0, 29, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->t_cache->raw_val); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error) - __pyx_v_text = ((char *)__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_cur->raw_val); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_v_text = ((char *)__pyx_t_5); - /* "kola/parser.pyx":24 - * int lineno = 1 + /* "kola/parser.pyx":25 * const char* text = "" - * if not self.t_cache is None: # <<<<<<<<<<<<<< + * Token cur = self.t_cache + * if not cur is None: # <<<<<<<<<<<<<< * lineno = self.t_cache.lineno * if errorno == 16: */ } - /* "kola/parser.pyx":29 - * errorno = (self.stat << 4) + self.t_cache.syn - * text = self.t_cache.raw_val + /* "kola/parser.pyx":30 + * errorno = (self.stat << 4) + cur.syn + * text = cur.raw_val * while not self.t_cache is None and not CMD <= self.t_cache.syn <= TEXT: # <<<<<<<<<<<<<< * self.t_cache = self.lexer.next_token() * kola_set_error(KoiLangSyntaxError, errorno, */ while (1) { - __pyx_t_1 = (((PyObject *)__pyx_v_self->t_cache) != Py_None); - __pyx_t_5 = (__pyx_t_1 != 0); - if (__pyx_t_5) { + __pyx_t_2 = (((PyObject *)__pyx_v_self->t_cache) != Py_None); + __pyx_t_6 = (__pyx_t_2 != 0); + if (__pyx_t_6) { } else { - __pyx_t_2 = __pyx_t_5; + __pyx_t_3 = __pyx_t_6; goto __pyx_L7_bool_binop_done; } - __pyx_t_5 = (CMD <= __pyx_v_self->t_cache->syn); - if (__pyx_t_5) { - __pyx_t_5 = (__pyx_v_self->t_cache->syn <= TEXT); + __pyx_t_6 = (CMD <= __pyx_v_self->t_cache->syn); + if (__pyx_t_6) { + __pyx_t_6 = (__pyx_v_self->t_cache->syn <= TEXT); } - __pyx_t_1 = ((!(__pyx_t_5 != 0)) != 0); - __pyx_t_2 = __pyx_t_1; + __pyx_t_2 = ((!(__pyx_t_6 != 0)) != 0); + __pyx_t_3 = __pyx_t_2; __pyx_L7_bool_binop_done:; - if (!__pyx_t_2) break; + if (!__pyx_t_3) break; - /* "kola/parser.pyx":30 - * text = self.t_cache.raw_val + /* "kola/parser.pyx":31 + * text = cur.raw_val * while not self.t_cache is None and not CMD <= self.t_cache.syn <= TEXT: * self.t_cache = self.lexer.next_token() # <<<<<<<<<<<<<< * kola_set_error(KoiLangSyntaxError, errorno, * self.lexer._filename, lineno, text) */ - __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_4kola_5lexer_BaseLexer *)__pyx_v_self->lexer->__pyx_vtab)->next_token(__pyx_v_self->lexer)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_5lexer_BaseLexer *)__pyx_v_self->lexer->__pyx_vtab)->next_token(__pyx_v_self->lexer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF((PyObject *)__pyx_v_self->t_cache); __Pyx_DECREF((PyObject *)__pyx_v_self->t_cache); - __pyx_v_self->t_cache = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_self->t_cache = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1); + __pyx_t_1 = 0; } - /* "kola/parser.pyx":31 + /* "kola/parser.pyx":32 * while not self.t_cache is None and not CMD <= self.t_cache.syn <= TEXT: * self.t_cache = self.lexer.next_token() * kola_set_error(KoiLangSyntaxError, errorno, # <<<<<<<<<<<<<< * self.lexer._filename, lineno, text) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_KoiLangSyntaxError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KoiLangSyntaxError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); - /* "kola/parser.pyx":32 + /* "kola/parser.pyx":33 * self.t_cache = self.lexer.next_token() * kola_set_error(KoiLangSyntaxError, errorno, * self.lexer._filename, lineno, text) # <<<<<<<<<<<<<< * * cpdef tuple parse_args(self): */ - kola_set_error(__pyx_t_6, __pyx_v_errorno, __pyx_v_self->lexer->_filename, __pyx_v_lineno, __pyx_v_text); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + kola_set_error(__pyx_t_1, __pyx_v_errorno, __pyx_v_self->lexer->_filename, __pyx_v_lineno, __pyx_v_text); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "kola/parser.pyx":20 * return n @@ -3726,13 +3702,14 @@ static void __pyx_f_4kola_6parser_6Parser_set_error(struct __pyx_obj_4kola_6pars /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_1); //__Pyx_AddTraceback("kola.parser.Parser.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_cur); __Pyx_RefNannyFinishContext(); } -/* "kola/parser.pyx":34 +/* "kola/parser.pyx":35 * self.lexer._filename, lineno, text) * * cpdef tuple parse_args(self): # <<<<<<<<<<<<<< @@ -3778,7 +3755,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parse_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parse_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #ifdef __Pyx_CyFunction_USED if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1) @@ -3804,11 +3781,11 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola PyObject *__pyx_callargs[1] = {__pyx_t_4, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(0, 34, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3827,7 +3804,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola #endif } - /* "kola/parser.pyx":36 + /* "kola/parser.pyx":37 * cpdef tuple parse_args(self): * cdef: * uint8_t stat = 1, action = 0 # <<<<<<<<<<<<<< @@ -3837,31 +3814,31 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __pyx_v_stat = 1; __pyx_v_action = 0; - /* "kola/parser.pyx":38 + /* "kola/parser.pyx":39 * uint8_t stat = 1, action = 0 * * list args = [] # <<<<<<<<<<<<<< * dict kwds = {} * object v */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":39 + /* "kola/parser.pyx":40 * * list args = [] * dict kwds = {} # <<<<<<<<<<<<<< * object v * Token i */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_kwds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":43 + /* "kola/parser.pyx":44 * Token i * * while True: # <<<<<<<<<<<<<< @@ -3870,7 +3847,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ while (1) { - /* "kola/parser.pyx":44 + /* "kola/parser.pyx":45 * * while True: * self.stat = stat # <<<<<<<<<<<<<< @@ -3879,19 +3856,19 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_v_self->stat = __pyx_v_stat; - /* "kola/parser.pyx":45 + /* "kola/parser.pyx":46 * while True: * self.stat = stat * i = self.lexer.next_token() # <<<<<<<<<<<<<< * if i is None: * stat = yy_goto[0][stat-1] */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_5lexer_BaseLexer *)__pyx_v_self->lexer->__pyx_vtab)->next_token(__pyx_v_self->lexer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_5lexer_BaseLexer *)__pyx_v_self->lexer->__pyx_vtab)->next_token(__pyx_v_self->lexer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)); __pyx_t_1 = 0; - /* "kola/parser.pyx":46 + /* "kola/parser.pyx":47 * self.stat = stat * i = self.lexer.next_token() * if i is None: # <<<<<<<<<<<<<< @@ -3902,7 +3879,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "kola/parser.pyx":47 + /* "kola/parser.pyx":48 * i = self.lexer.next_token() * if i is None: * stat = yy_goto[0][stat-1] # <<<<<<<<<<<<<< @@ -3911,7 +3888,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_v_stat = ((yy_goto[0])[(__pyx_v_stat - 1)]); - /* "kola/parser.pyx":46 + /* "kola/parser.pyx":47 * self.stat = stat * i = self.lexer.next_token() * if i is None: # <<<<<<<<<<<<<< @@ -3921,7 +3898,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola goto __pyx_L5; } - /* "kola/parser.pyx":49 + /* "kola/parser.pyx":50 * stat = yy_goto[0][stat-1] * else: * stat = yy_goto[i.get_flag()][stat - 1] # <<<<<<<<<<<<<< @@ -3933,7 +3910,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola } __pyx_L5:; - /* "kola/parser.pyx":50 + /* "kola/parser.pyx":51 * else: * stat = yy_goto[i.get_flag()][stat - 1] * action = stat >> 4 # <<<<<<<<<<<<<< @@ -3942,7 +3919,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_v_action = (__pyx_v_stat >> 4); - /* "kola/parser.pyx":51 + /* "kola/parser.pyx":52 * stat = yy_goto[i.get_flag()][stat - 1] * action = stat >> 4 * stat &= 0x0F # <<<<<<<<<<<<<< @@ -3951,7 +3928,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_v_stat = (__pyx_v_stat & 0x0F); - /* "kola/parser.pyx":53 + /* "kola/parser.pyx":54 * stat &= 0x0F * * if action == 1: # <<<<<<<<<<<<<< @@ -3961,7 +3938,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola switch (__pyx_v_action) { case 1: - /* "kola/parser.pyx":54 + /* "kola/parser.pyx":55 * * if action == 1: * args.append(i.val) # <<<<<<<<<<<<<< @@ -3970,10 +3947,10 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_t_1 = __pyx_v_i->val; __Pyx_INCREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":53 + /* "kola/parser.pyx":54 * stat &= 0x0F * * if action == 1: # <<<<<<<<<<<<<< @@ -3983,7 +3960,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 2: - /* "kola/parser.pyx":56 + /* "kola/parser.pyx":57 * args.append(i.val) * elif action == 2: * self.push(i) # <<<<<<<<<<<<<< @@ -3992,7 +3969,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->push(__pyx_v_self, __pyx_v_i, 0); - /* "kola/parser.pyx":55 + /* "kola/parser.pyx":56 * if action == 1: * args.append(i.val) * elif action == 2: # <<<<<<<<<<<<<< @@ -4002,22 +3979,22 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 3: - /* "kola/parser.pyx":58 + /* "kola/parser.pyx":59 * self.push(i) * elif action == 3: * args.append(self.pop().val) # <<<<<<<<<<<<<< * elif action == 4: * v = self.pop().val */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)->val; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "kola/parser.pyx":57 + /* "kola/parser.pyx":58 * elif action == 2: * self.push(i) * elif action == 3: # <<<<<<<<<<<<<< @@ -4027,14 +4004,14 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 4: - /* "kola/parser.pyx":60 + /* "kola/parser.pyx":61 * args.append(self.pop().val) * elif action == 4: * v = self.pop().val # <<<<<<<<<<<<<< * i = self.pop() * if not i.syn == LITERAL: */ - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_2)->val; __Pyx_INCREF(__pyx_t_1); @@ -4042,19 +4019,19 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":61 + /* "kola/parser.pyx":62 * elif action == 4: * v = self.pop().val * i = self.pop() # <<<<<<<<<<<<<< * if not i.syn == LITERAL: * self.t_cache = i */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_i, ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)); __pyx_t_1 = 0; - /* "kola/parser.pyx":62 + /* "kola/parser.pyx":63 * v = self.pop().val * i = self.pop() * if not i.syn == LITERAL: # <<<<<<<<<<<<<< @@ -4064,7 +4041,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __pyx_t_7 = ((!((__pyx_v_i->syn == LITERAL) != 0)) != 0); if (__pyx_t_7) { - /* "kola/parser.pyx":63 + /* "kola/parser.pyx":64 * i = self.pop() * if not i.syn == LITERAL: * self.t_cache = i # <<<<<<<<<<<<<< @@ -4077,7 +4054,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __Pyx_DECREF((PyObject *)__pyx_v_self->t_cache); __pyx_v_self->t_cache = __pyx_v_i; - /* "kola/parser.pyx":64 + /* "kola/parser.pyx":65 * if not i.syn == LITERAL: * self.t_cache = i * self.set_error(201) # <<<<<<<<<<<<<< @@ -4086,9 +4063,9 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_t_9.__pyx_n = 1; __pyx_t_9.errorno = 0xC9; - ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, &__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error) + ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, &__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error) - /* "kola/parser.pyx":62 + /* "kola/parser.pyx":63 * v = self.pop().val * i = self.pop() * if not i.syn == LITERAL: # <<<<<<<<<<<<<< @@ -4097,16 +4074,16 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ } - /* "kola/parser.pyx":65 + /* "kola/parser.pyx":66 * self.t_cache = i * self.set_error(201) * kwds[i.val] = v # <<<<<<<<<<<<<< * elif action == 5: * i = self.pop() */ - if (unlikely((PyDict_SetItem(__pyx_v_kwds, __pyx_v_i->val, __pyx_v_v) < 0))) __PYX_ERR(0, 65, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_kwds, __pyx_v_i->val, __pyx_v_v) < 0))) __PYX_ERR(0, 66, __pyx_L1_error) - /* "kola/parser.pyx":59 + /* "kola/parser.pyx":60 * elif action == 3: * args.append(self.pop().val) * elif action == 4: # <<<<<<<<<<<<<< @@ -4116,19 +4093,19 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 5: - /* "kola/parser.pyx":67 + /* "kola/parser.pyx":68 * kwds[i.val] = v * elif action == 5: * i = self.pop() # <<<<<<<<<<<<<< * if not i.syn == LITERAL: * self.t_cache = i */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_i, ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)); __pyx_t_1 = 0; - /* "kola/parser.pyx":68 + /* "kola/parser.pyx":69 * elif action == 5: * i = self.pop() * if not i.syn == LITERAL: # <<<<<<<<<<<<<< @@ -4138,7 +4115,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __pyx_t_7 = ((!((__pyx_v_i->syn == LITERAL) != 0)) != 0); if (__pyx_t_7) { - /* "kola/parser.pyx":69 + /* "kola/parser.pyx":70 * i = self.pop() * if not i.syn == LITERAL: * self.t_cache = i # <<<<<<<<<<<<<< @@ -4151,7 +4128,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __Pyx_DECREF((PyObject *)__pyx_v_self->t_cache); __pyx_v_self->t_cache = __pyx_v_i; - /* "kola/parser.pyx":70 + /* "kola/parser.pyx":71 * if not i.syn == LITERAL: * self.t_cache = i * self.set_error(202) # <<<<<<<<<<<<<< @@ -4160,9 +4137,9 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_t_9.__pyx_n = 1; __pyx_t_9.errorno = 0xCA; - ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, &__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error) + ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, &__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error) - /* "kola/parser.pyx":68 + /* "kola/parser.pyx":69 * elif action == 5: * i = self.pop() * if not i.syn == LITERAL: # <<<<<<<<<<<<<< @@ -4171,17 +4148,17 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ } - /* "kola/parser.pyx":71 + /* "kola/parser.pyx":72 * self.t_cache = i * self.set_error(202) * kwds[i.val] = v # <<<<<<<<<<<<<< * elif action == 6: * v = [self.pop().val] */ - if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 71, __pyx_L1_error) } - if (unlikely((PyDict_SetItem(__pyx_v_kwds, __pyx_v_i->val, __pyx_v_v) < 0))) __PYX_ERR(0, 71, __pyx_L1_error) + if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 72, __pyx_L1_error) } + if (unlikely((PyDict_SetItem(__pyx_v_kwds, __pyx_v_i->val, __pyx_v_v) < 0))) __PYX_ERR(0, 72, __pyx_L1_error) - /* "kola/parser.pyx":66 + /* "kola/parser.pyx":67 * self.set_error(201) * kwds[i.val] = v * elif action == 5: # <<<<<<<<<<<<<< @@ -4191,16 +4168,16 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 6: - /* "kola/parser.pyx":73 + /* "kola/parser.pyx":74 * kwds[i.val] = v * elif action == 6: * v = [self.pop().val] # <<<<<<<<<<<<<< * elif action == 7: * (v).append(i.val) */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)->val); __Pyx_GIVEREF(((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)->val); @@ -4209,7 +4186,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0; - /* "kola/parser.pyx":72 + /* "kola/parser.pyx":73 * self.set_error(202) * kwds[i.val] = v * elif action == 6: # <<<<<<<<<<<<<< @@ -4219,24 +4196,24 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 7: - /* "kola/parser.pyx":75 + /* "kola/parser.pyx":76 * v = [self.pop().val] * elif action == 7: * (v).append(i.val) # <<<<<<<<<<<<<< * elif action == 8: * v = {} */ - if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 75, __pyx_L1_error) } + if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 76, __pyx_L1_error) } if (unlikely(__pyx_v_v == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); - __PYX_ERR(0, 75, __pyx_L1_error) + __PYX_ERR(0, 76, __pyx_L1_error) } __pyx_t_2 = __pyx_v_i->val; __Pyx_INCREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyList_Append(((PyObject*)__pyx_v_v), __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(((PyObject*)__pyx_v_v), __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "kola/parser.pyx":74 + /* "kola/parser.pyx":75 * elif action == 6: * v = [self.pop().val] * elif action == 7: # <<<<<<<<<<<<<< @@ -4246,19 +4223,19 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 8: - /* "kola/parser.pyx":77 + /* "kola/parser.pyx":78 * (v).append(i.val) * elif action == 8: * v = {} # <<<<<<<<<<<<<< * elif action == 9: * (v)[self.pop().val] = i.val */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0; - /* "kola/parser.pyx":76 + /* "kola/parser.pyx":77 * elif action == 7: * (v).append(i.val) * elif action == 8: # <<<<<<<<<<<<<< @@ -4268,7 +4245,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 9: - /* "kola/parser.pyx":79 + /* "kola/parser.pyx":80 * v = {} * elif action == 9: * (v)[self.pop().val] = i.val # <<<<<<<<<<<<<< @@ -4277,18 +4254,18 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ __pyx_t_2 = __pyx_v_i->val; __Pyx_INCREF(__pyx_t_2); - if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 79, __pyx_L1_error) } + if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); __PYX_ERR(0, 80, __pyx_L1_error) } if (unlikely(__pyx_v_v == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 79, __pyx_L1_error) + __PYX_ERR(0, 80, __pyx_L1_error) } - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(((PyObject*)__pyx_v_v), ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)->val, __pyx_t_2) < 0))) __PYX_ERR(0, 79, __pyx_L1_error) + if (unlikely((PyDict_SetItem(((PyObject*)__pyx_v_v), ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)->val, __pyx_t_2) < 0))) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "kola/parser.pyx":78 + /* "kola/parser.pyx":79 * elif action == 8: * v = {} * elif action == 9: # <<<<<<<<<<<<<< @@ -4298,22 +4275,22 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 10: - /* "kola/parser.pyx":81 + /* "kola/parser.pyx":82 * (v)[self.pop().val] = i.val * elif action == 10: * args.append(self.pop().val) # <<<<<<<<<<<<<< * self.push(i) * */ - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->pop(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_2)->val; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":82 + /* "kola/parser.pyx":83 * elif action == 10: * args.append(self.pop().val) * self.push(i) # <<<<<<<<<<<<<< @@ -4322,7 +4299,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->push(__pyx_v_self, __pyx_v_i, 0); - /* "kola/parser.pyx":80 + /* "kola/parser.pyx":81 * elif action == 9: * (v)[self.pop().val] = i.val * elif action == 10: # <<<<<<<<<<<<<< @@ -4333,7 +4310,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola default: break; } - /* "kola/parser.pyx":84 + /* "kola/parser.pyx":85 * self.push(i) * * if stat == 15: # <<<<<<<<<<<<<< @@ -4343,7 +4320,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola switch (__pyx_v_stat) { case 15: - /* "kola/parser.pyx":85 + /* "kola/parser.pyx":86 * * if stat == 15: * break # <<<<<<<<<<<<<< @@ -4352,7 +4329,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ goto __pyx_L4_break; - /* "kola/parser.pyx":84 + /* "kola/parser.pyx":85 * self.push(i) * * if stat == 15: # <<<<<<<<<<<<<< @@ -4362,7 +4339,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola break; case 0: - /* "kola/parser.pyx":87 + /* "kola/parser.pyx":88 * break * elif stat == 0: * self.t_cache = i # <<<<<<<<<<<<<< @@ -4375,16 +4352,16 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __Pyx_DECREF((PyObject *)__pyx_v_self->t_cache); __pyx_v_self->t_cache = __pyx_v_i; - /* "kola/parser.pyx":88 + /* "kola/parser.pyx":89 * elif stat == 0: * self.t_cache = i * self.set_error() # <<<<<<<<<<<<<< * * if not self.stack_top is None: */ - ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) - /* "kola/parser.pyx":86 + /* "kola/parser.pyx":87 * if stat == 15: * break * elif stat == 0: # <<<<<<<<<<<<<< @@ -4397,7 +4374,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola } __pyx_L4_break:; - /* "kola/parser.pyx":90 + /* "kola/parser.pyx":91 * self.set_error() * * if not self.stack_top is None: # <<<<<<<<<<<<<< @@ -4408,7 +4385,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { - /* "kola/parser.pyx":91 + /* "kola/parser.pyx":92 * * if not self.stack_top is None: * self.t_cache = self.stack_top # <<<<<<<<<<<<<< @@ -4423,7 +4400,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __pyx_v_self->t_cache = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":92 + /* "kola/parser.pyx":93 * if not self.stack_top is None: * self.t_cache = self.stack_top * self.stack_top = None # <<<<<<<<<<<<<< @@ -4436,16 +4413,16 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __Pyx_DECREF((PyObject *)__pyx_v_self->stack_top); __pyx_v_self->stack_top = ((struct __pyx_obj_4kola_5lexer_Token *)Py_None); - /* "kola/parser.pyx":93 + /* "kola/parser.pyx":94 * self.t_cache = self.stack_top * self.stack_top = None * self.set_error() # <<<<<<<<<<<<<< * * self.t_cache = i */ - ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) + ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->set_error(__pyx_v_self, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error) - /* "kola/parser.pyx":90 + /* "kola/parser.pyx":91 * self.set_error() * * if not self.stack_top is None: # <<<<<<<<<<<<<< @@ -4454,21 +4431,21 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola */ } - /* "kola/parser.pyx":95 + /* "kola/parser.pyx":96 * self.set_error() * * self.t_cache = i # <<<<<<<<<<<<<< * return tuple(args), kwds * */ - if (unlikely(!__pyx_v_i)) { __Pyx_RaiseUnboundLocalError("i"); __PYX_ERR(0, 95, __pyx_L1_error) } + if (unlikely(!__pyx_v_i)) { __Pyx_RaiseUnboundLocalError("i"); __PYX_ERR(0, 96, __pyx_L1_error) } __Pyx_INCREF((PyObject *)__pyx_v_i); __Pyx_GIVEREF((PyObject *)__pyx_v_i); __Pyx_GOTREF((PyObject *)__pyx_v_self->t_cache); __Pyx_DECREF((PyObject *)__pyx_v_self->t_cache); __pyx_v_self->t_cache = __pyx_v_i; - /* "kola/parser.pyx":96 + /* "kola/parser.pyx":97 * * self.t_cache = i * return tuple(args), kwds # <<<<<<<<<<<<<< @@ -4476,9 +4453,9 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola * cpdef object exec_once(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_AsTuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_1 = PyList_AsTuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -4490,7 +4467,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_parse_args(struct __pyx_obj_4kola __pyx_t_2 = 0; goto __pyx_L0; - /* "kola/parser.pyx":34 + /* "kola/parser.pyx":35 * self.lexer._filename, lineno, text) * * cpdef tuple parse_args(self): # <<<<<<<<<<<<<< @@ -4558,7 +4535,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_6parse_args(struct __pyx_obj_4ko int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_args", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4kola_6parser_6Parser_parse_args(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4kola_6parser_6Parser_parse_args(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4575,7 +4552,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_6parse_args(struct __pyx_obj_4ko return __pyx_r; } -/* "kola/parser.pyx":98 +/* "kola/parser.pyx":99 * return tuple(args), kwds * * cpdef object exec_once(self): # <<<<<<<<<<<<<< @@ -4609,19 +4586,15 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; - Py_UCS4 __pyx_t_14; + char const *__pyx_t_11; + int __pyx_t_12; + char const *__pyx_t_13; + PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; - int __pyx_t_16; - char const *__pyx_t_17; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - PyObject *__pyx_t_22 = NULL; - PyObject *__pyx_t_23 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -4635,7 +4608,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exec_once); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exec_once); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #ifdef __Pyx_CyFunction_USED if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1) @@ -4661,7 +4634,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ PyObject *__pyx_callargs[1] = {__pyx_t_4, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -4683,7 +4656,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ #endif } - /* "kola/parser.pyx":105 + /* "kola/parser.pyx":106 * Token token * * token = self.t_cache # <<<<<<<<<<<<<< @@ -4695,7 +4668,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_v_token = ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":106 + /* "kola/parser.pyx":107 * * token = self.t_cache * if token is None: # <<<<<<<<<<<<<< @@ -4706,19 +4679,19 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { - /* "kola/parser.pyx":107 + /* "kola/parser.pyx":108 * token = self.t_cache * if token is None: * token = self.lexer.next_token() # <<<<<<<<<<<<<< * if token is None: * self.stat = 255 */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_5lexer_BaseLexer *)__pyx_v_self->lexer->__pyx_vtab)->next_token(__pyx_v_self->lexer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4kola_5lexer_BaseLexer *)__pyx_v_self->lexer->__pyx_vtab)->next_token(__pyx_v_self->lexer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_token, ((struct __pyx_obj_4kola_5lexer_Token *)__pyx_t_1)); __pyx_t_1 = 0; - /* "kola/parser.pyx":108 + /* "kola/parser.pyx":109 * if token is None: * token = self.lexer.next_token() * if token is None: # <<<<<<<<<<<<<< @@ -4729,7 +4702,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_t_6 = (__pyx_t_7 != 0); if (__pyx_t_6) { - /* "kola/parser.pyx":109 + /* "kola/parser.pyx":110 * token = self.lexer.next_token() * if token is None: * self.stat = 255 # <<<<<<<<<<<<<< @@ -4738,7 +4711,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ */ __pyx_v_self->stat = 0xFF; - /* "kola/parser.pyx":110 + /* "kola/parser.pyx":111 * if token is None: * self.stat = 255 * return # <<<<<<<<<<<<<< @@ -4749,7 +4722,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "kola/parser.pyx":108 + /* "kola/parser.pyx":109 * if token is None: * token = self.lexer.next_token() * if token is None: # <<<<<<<<<<<<<< @@ -4758,7 +4731,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ */ } - /* "kola/parser.pyx":106 + /* "kola/parser.pyx":107 * * token = self.t_cache * if token is None: # <<<<<<<<<<<<<< @@ -4767,19 +4740,19 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ */ } - /* "kola/parser.pyx":112 + /* "kola/parser.pyx":113 * return * * args = self.parse_args() # <<<<<<<<<<<<<< * kwds = args[1] * args = args[0] */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->parse_args(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->parse_args(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":113 + /* "kola/parser.pyx":114 * * args = self.parse_args() * kwds = args[1] # <<<<<<<<<<<<<< @@ -4788,9 +4761,9 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 113, __pyx_L1_error) + __PYX_ERR(0, 114, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); @@ -4798,7 +4771,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_v_kwds = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "kola/parser.pyx":114 + /* "kola/parser.pyx":115 * args = self.parse_args() * kwds = args[1] * args = args[0] # <<<<<<<<<<<<<< @@ -4807,9 +4780,9 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 114, __pyx_L1_error) + __PYX_ERR(0, 115, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); @@ -4817,7 +4790,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "kola/parser.pyx":116 + /* "kola/parser.pyx":117 * args = args[0] * * if token.syn == CMD: # <<<<<<<<<<<<<< @@ -4827,7 +4800,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ switch (__pyx_v_token->syn) { case CMD: - /* "kola/parser.pyx":117 + /* "kola/parser.pyx":118 * * if token.syn == CMD: * name = token.val # <<<<<<<<<<<<<< @@ -4839,7 +4812,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_v_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":116 + /* "kola/parser.pyx":117 * args = args[0] * * if token.syn == CMD: # <<<<<<<<<<<<<< @@ -4849,7 +4822,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ break; case CMD_N: - /* "kola/parser.pyx":119 + /* "kola/parser.pyx":120 * name = token.val * elif token.syn == CMD_N: * name = "@number" # <<<<<<<<<<<<<< @@ -4859,25 +4832,25 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_INCREF(__pyx_kp_u_number); __pyx_v_name = __pyx_kp_u_number; - /* "kola/parser.pyx":120 + /* "kola/parser.pyx":121 * elif token.syn == CMD_N: * name = "@number" * args = (token.val,) + args # <<<<<<<<<<<<<< * elif token.syn == TEXT: * name = "@text" */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_token->val); __Pyx_GIVEREF(__pyx_v_token->val); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_token->val); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "kola/parser.pyx":118 + /* "kola/parser.pyx":119 * if token.syn == CMD: * name = token.val * elif token.syn == CMD_N: # <<<<<<<<<<<<<< @@ -4887,7 +4860,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ break; case TEXT: - /* "kola/parser.pyx":122 + /* "kola/parser.pyx":123 * args = (token.val,) + args * elif token.syn == TEXT: * name = "@text" # <<<<<<<<<<<<<< @@ -4897,14 +4870,14 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_INCREF(__pyx_kp_u_text); __pyx_v_name = __pyx_kp_u_text; - /* "kola/parser.pyx":123 + /* "kola/parser.pyx":124 * elif token.syn == TEXT: * name = "@text" * args = (token.val,) # <<<<<<<<<<<<<< * try: * cmd = self.command_set[name] */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_token->val); __Pyx_GIVEREF(__pyx_v_token->val); @@ -4912,7 +4885,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "kola/parser.pyx":121 + /* "kola/parser.pyx":122 * name = "@number" * args = (token.val,) + args * elif token.syn == TEXT: # <<<<<<<<<<<<<< @@ -4923,7 +4896,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ default: break; } - /* "kola/parser.pyx":124 + /* "kola/parser.pyx":125 * name = "@text" * args = (token.val,) * try: # <<<<<<<<<<<<<< @@ -4939,20 +4912,20 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { - /* "kola/parser.pyx":125 + /* "kola/parser.pyx":126 * args = (token.val,) * try: * cmd = self.command_set[name] # <<<<<<<<<<<<<< * except KeyError: - * raise KoiLangCommandError(f"command '{name}' not found") from None + * kola_set_errcause(KoiLangCommandError, 2, */ - if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(0, 125, __pyx_L5_error) } - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->command_set, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L5_error) + if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(0, 126, __pyx_L5_error) } + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_self->command_set, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_cmd = __pyx_t_2; __pyx_t_2 = 0; - /* "kola/parser.pyx":124 + /* "kola/parser.pyx":125 * name = "@text" * args = (token.val,) * try: # <<<<<<<<<<<<<< @@ -4970,82 +4943,62 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "kola/parser.pyx":126 + /* "kola/parser.pyx":127 * try: * cmd = self.command_set[name] * except KeyError: # <<<<<<<<<<<<<< - * raise KoiLangCommandError(f"command '{name}' not found") from None - * + * kola_set_errcause(KoiLangCommandError, 2, + * self.lexer._filename, token.lineno, token.raw_val, None) */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("kola.parser.Parser.exec_once", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L7_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 127, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); - /* "kola/parser.pyx":127 + /* "kola/parser.pyx":128 * cmd = self.command_set[name] * except KeyError: - * raise KoiLangCommandError(f"command '{name}' not found") from None # <<<<<<<<<<<<<< + * kola_set_errcause(KoiLangCommandError, 2, # <<<<<<<<<<<<<< + * self.lexer._filename, token.lineno, token.raw_val, None) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KoiLangCommandError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "kola/parser.pyx":129 + * except KeyError: + * kola_set_errcause(KoiLangCommandError, 2, + * self.lexer._filename, token.lineno, token.raw_val, None) # <<<<<<<<<<<<<< * * try: */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_KoiLangCommandError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 127, __pyx_L7_except_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 127, __pyx_L7_except_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = 0; - __pyx_t_14 = 127; - __Pyx_INCREF(__pyx_kp_u_command); - __pyx_t_13 += 9; - __Pyx_GIVEREF(__pyx_kp_u_command); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_u_command); - if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(0, 127, __pyx_L7_except_error) } - __pyx_t_15 = __Pyx_PyUnicode_Unicode(__pyx_v_name); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 127, __pyx_L7_except_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_14; - __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15); - __Pyx_GIVEREF(__pyx_t_15); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_15); - __pyx_t_15 = 0; - __Pyx_INCREF(__pyx_kp_u_not_found); - __pyx_t_13 += 11; - __Pyx_GIVEREF(__pyx_kp_u_not_found); - PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_kp_u_not_found); - __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 127, __pyx_L7_except_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_15}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L7_except_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(__pyx_v_token->raw_val == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 129, __pyx_L7_except_error) } - __Pyx_Raise(__pyx_t_4, 0, 0, Py_None); + __pyx_t_11 = __Pyx_PyBytes_AsString(__pyx_v_token->raw_val); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L7_except_error) + + /* "kola/parser.pyx":128 + * cmd = self.command_set[name] + * except KeyError: + * kola_set_errcause(KoiLangCommandError, 2, # <<<<<<<<<<<<<< + * self.lexer._filename, token.lineno, token.raw_val, None) + * + */ + kola_set_errcause(__pyx_t_4, 2, __pyx_v_self->lexer->_filename, __pyx_v_token->lineno, __pyx_t_11, Py_None); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 127, __pyx_L7_except_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L6_exception_handled; } goto __pyx_L7_except_error; __pyx_L7_except_error:; - /* "kola/parser.pyx":124 + /* "kola/parser.pyx":125 * name = "@text" * args = (token.val,) * try: # <<<<<<<<<<<<<< @@ -5057,11 +5010,16 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_L10_try_end:; } - /* "kola/parser.pyx":129 - * raise KoiLangCommandError(f"command '{name}' not found") from None + /* "kola/parser.pyx":131 + * self.lexer._filename, token.lineno, token.raw_val, None) * * try: # <<<<<<<<<<<<<< * return cmd(*args, **kwds) @@ -5076,7 +5034,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { - /* "kola/parser.pyx":130 + /* "kola/parser.pyx":132 * * try: * return cmd(*args, **kwds) # <<<<<<<<<<<<<< @@ -5084,25 +5042,26 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ * raise */ __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_cmd)) { __Pyx_RaiseUnboundLocalError("cmd"); __PYX_ERR(0, 132, __pyx_L13_error) } if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 130, __pyx_L13_error) + __PYX_ERR(0, 132, __pyx_L13_error) } if (unlikely(__pyx_v_kwds == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); - __PYX_ERR(0, 130, __pyx_L13_error) + __PYX_ERR(0, 132, __pyx_L13_error) } - __pyx_t_3 = PyDict_Copy(__pyx_v_kwds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L13_error) + __pyx_t_3 = PyDict_Copy(__pyx_v_kwds); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_cmd, __pyx_v_args, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L13_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_cmd, __pyx_v_args, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L17_try_return; - /* "kola/parser.pyx":129 - * raise KoiLangCommandError(f"command '{name}' not found") from None + /* "kola/parser.pyx":131 + * self.lexer._filename, token.lineno, token.raw_val, None) * * try: # <<<<<<<<<<<<<< * return cmd(*args, **kwds) @@ -5111,14 +5070,11 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ } __pyx_L13_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "kola/parser.pyx":131 + /* "kola/parser.pyx":133 * try: * return cmd(*args, **kwds) * except KoiLangError: # <<<<<<<<<<<<<< @@ -5126,7 +5082,7 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ * except Exception as e: */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KoiLangError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L15_except_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KoiLangError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L15_except_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5134,37 +5090,37 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; if (__pyx_t_5) { __Pyx_AddTraceback("kola.parser.Parser.exec_once", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 131, __pyx_L15_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L15_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); - /* "kola/parser.pyx":132 + /* "kola/parser.pyx":134 * return cmd(*args, **kwds) * except KoiLangError: * raise # <<<<<<<<<<<<<< * except Exception as e: - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e + * kola_set_errcause(KoiLangCommandError, 3, */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; - __PYX_ERR(0, 132, __pyx_L15_except_error) + __PYX_ERR(0, 134, __pyx_L15_except_error) } - /* "kola/parser.pyx":133 + /* "kola/parser.pyx":135 * except KoiLangError: * raise * except Exception as e: # <<<<<<<<<<<<<< - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e - * + * kola_set_errcause(KoiLangCommandError, 3, + * self.lexer._filename, token.lineno, token.raw_val, e) */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_5) { __Pyx_AddTraceback("kola.parser.Parser.exec_once", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 133, __pyx_L15_except_error) + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 135, __pyx_L15_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_2); @@ -5172,114 +5128,96 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __pyx_v_e = __pyx_t_3; /*try:*/ { - /* "kola/parser.pyx":134 + /* "kola/parser.pyx":136 * raise * except Exception as e: - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e # <<<<<<<<<<<<<< + * kola_set_errcause(KoiLangCommandError, 3, # <<<<<<<<<<<<<< + * self.lexer._filename, token.lineno, token.raw_val, e) * - * cpdef void exec_(self) except *: */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_KoiLangCommandError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 134, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 134, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_13 = 0; - __pyx_t_14 = 127; - __Pyx_INCREF(__pyx_kp_u_an_error_occured_during_handling); - __pyx_t_13 += 42; - __Pyx_GIVEREF(__pyx_kp_u_an_error_occured_during_handling); - PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_kp_u_an_error_occured_during_handling); - if (unlikely(!__pyx_v_name)) { __Pyx_RaiseUnboundLocalError("name"); __PYX_ERR(0, 134, __pyx_L26_error) } - __pyx_t_12 = __Pyx_PyUnicode_Unicode(__pyx_v_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 134, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_14; - __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_12); - __pyx_t_12 = 0; - __Pyx_INCREF(__pyx_kp_u_); - __pyx_t_13 += 1; - __Pyx_GIVEREF(__pyx_kp_u_); - PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_kp_u_); - __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 134, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_15)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_15); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_12}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L26_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KoiLangCommandError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L26_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "kola/parser.pyx":137 + * except Exception as e: + * kola_set_errcause(KoiLangCommandError, 3, + * self.lexer._filename, token.lineno, token.raw_val, e) # <<<<<<<<<<<<<< + * + * + */ + if (unlikely(__pyx_v_token->raw_val == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 137, __pyx_L26_error) } - __Pyx_Raise(__pyx_t_4, 0, 0, __pyx_v_e); + __pyx_t_11 = __Pyx_PyBytes_AsString(__pyx_v_token->raw_val); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L26_error) + + /* "kola/parser.pyx":136 + * raise + * except Exception as e: + * kola_set_errcause(KoiLangCommandError, 3, # <<<<<<<<<<<<<< + * self.lexer._filename, token.lineno, token.raw_val, e) + * + */ + kola_set_errcause(__pyx_t_4, 3, __pyx_v_self->lexer->_filename, __pyx_v_token->lineno, __pyx_t_11, __pyx_v_e); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L26_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 134, __pyx_L26_error) } - /* "kola/parser.pyx":133 + /* "kola/parser.pyx":135 * except KoiLangError: * raise * except Exception as e: # <<<<<<<<<<<<<< - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e - * + * kola_set_errcause(KoiLangCommandError, 3, + * self.lexer._filename, token.lineno, token.raw_val, e) */ /*finally:*/ { + /*normal exit:*/{ + __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; + goto __pyx_L27; + } __pyx_L26_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); - __Pyx_XGOTREF(__pyx_t_20); - __Pyx_XGOTREF(__pyx_t_21); - __Pyx_XGOTREF(__pyx_t_22); - __Pyx_XGOTREF(__pyx_t_23); - __pyx_t_5 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename; + __pyx_t_5 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } if (PY_MAJOR_VERSION >= 3) { - __Pyx_XGIVEREF(__pyx_t_21); - __Pyx_XGIVEREF(__pyx_t_22); - __Pyx_XGIVEREF(__pyx_t_23); - __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); } - __Pyx_XGIVEREF(__pyx_t_18); - __Pyx_XGIVEREF(__pyx_t_19); - __Pyx_XGIVEREF(__pyx_t_20); - __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20); - __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; - __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17; + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; goto __pyx_L15_except_error; } + __pyx_L27:; } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L14_exception_handled; } goto __pyx_L15_except_error; __pyx_L15_except_error:; - /* "kola/parser.pyx":129 - * raise KoiLangCommandError(f"command '{name}' not found") from None + /* "kola/parser.pyx":131 + * self.lexer._filename, token.lineno, token.raw_val, None) * * try: # <<<<<<<<<<<<<< * return cmd(*args, **kwds) @@ -5296,9 +5234,14 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); goto __pyx_L0; + __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8); } - /* "kola/parser.pyx":98 + /* "kola/parser.pyx":99 * return tuple(args), kwds * * cpdef object exec_once(self): # <<<<<<<<<<<<<< @@ -5307,14 +5250,13 @@ static PyObject *__pyx_f_4kola_6parser_6Parser_exec_once(struct __pyx_obj_4kola_ */ /* function exit code */ + __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_4); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("kola.parser.Parser.exec_once", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -5371,7 +5313,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_8exec_once(struct __pyx_obj_4kol int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exec_once", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4kola_6parser_6Parser_exec_once(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4kola_6parser_6Parser_exec_once(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5388,8 +5330,8 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_8exec_once(struct __pyx_obj_4kol return __pyx_r; } -/* "kola/parser.pyx":136 - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e +/* "kola/parser.pyx":140 + * * * cpdef void exec_(self) except *: # <<<<<<<<<<<<<< * self.exec_once() @@ -5425,7 +5367,7 @@ static void __pyx_f_4kola_6parser_6Parser_exec_(struct __pyx_obj_4kola_6parser_P if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #ifdef __Pyx_CyFunction_USED if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1) @@ -5450,7 +5392,7 @@ static void __pyx_f_4kola_6parser_6Parser_exec_(struct __pyx_obj_4kola_6parser_P PyObject *__pyx_callargs[1] = {__pyx_t_4, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -5471,18 +5413,18 @@ static void __pyx_f_4kola_6parser_6Parser_exec_(struct __pyx_obj_4kola_6parser_P #endif } - /* "kola/parser.pyx":137 + /* "kola/parser.pyx":141 * * cpdef void exec_(self) except *: * self.exec_once() # <<<<<<<<<<<<<< * while not self.t_cache is None: * self.exec_once() */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->exec_once(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->exec_once(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "kola/parser.pyx":138 + /* "kola/parser.pyx":142 * cpdef void exec_(self) except *: * self.exec_once() * while not self.t_cache is None: # <<<<<<<<<<<<<< @@ -5494,20 +5436,20 @@ static void __pyx_f_4kola_6parser_6Parser_exec_(struct __pyx_obj_4kola_6parser_P __pyx_t_7 = (__pyx_t_6 != 0); if (!__pyx_t_7) break; - /* "kola/parser.pyx":139 + /* "kola/parser.pyx":143 * self.exec_once() * while not self.t_cache is None: * self.exec_once() # <<<<<<<<<<<<<< * * def __iter__(self): */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->exec_once(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->exec_once(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "kola/parser.pyx":136 - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e + /* "kola/parser.pyx":140 + * * * cpdef void exec_(self) except *: # <<<<<<<<<<<<<< * self.exec_once() @@ -5568,8 +5510,8 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_10exec_(struct __pyx_obj_4kola_6 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exec_", 0); __Pyx_XDECREF(__pyx_r); - __pyx_f_4kola_6parser_6Parser_exec_(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error) - __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_f_4kola_6parser_6Parser_exec_(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5586,7 +5528,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_10exec_(struct __pyx_obj_4kola_6 return __pyx_r; } -/* "kola/parser.pyx":141 +/* "kola/parser.pyx":145 * self.exec_once() * * def __iter__(self): # <<<<<<<<<<<<<< @@ -5613,7 +5555,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_12__iter__(struct __pyx_obj_4kol __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); - /* "kola/parser.pyx":142 + /* "kola/parser.pyx":146 * * def __iter__(self): * return self # <<<<<<<<<<<<<< @@ -5625,7 +5567,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_12__iter__(struct __pyx_obj_4kol __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; - /* "kola/parser.pyx":141 + /* "kola/parser.pyx":145 * self.exec_once() * * def __iter__(self): # <<<<<<<<<<<<<< @@ -5640,7 +5582,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_12__iter__(struct __pyx_obj_4kol return __pyx_r; } -/* "kola/parser.pyx":144 +/* "kola/parser.pyx":148 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -5673,19 +5615,19 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_14__next__(struct __pyx_obj_4kol int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__next__", 0); - /* "kola/parser.pyx":145 + /* "kola/parser.pyx":149 * * def __next__(self): * ret = self.exec_once() # <<<<<<<<<<<<<< * if self.stat == 255: * raise StopIteration */ - __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->exec_once(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_4kola_6parser_Parser *)__pyx_v_self->__pyx_vtab)->exec_once(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ret = __pyx_t_1; __pyx_t_1 = 0; - /* "kola/parser.pyx":146 + /* "kola/parser.pyx":150 * def __next__(self): * ret = self.exec_once() * if self.stat == 255: # <<<<<<<<<<<<<< @@ -5695,7 +5637,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_14__next__(struct __pyx_obj_4kol __pyx_t_2 = ((__pyx_v_self->stat == 0xFF) != 0); if (unlikely(__pyx_t_2)) { - /* "kola/parser.pyx":147 + /* "kola/parser.pyx":151 * ret = self.exec_once() * if self.stat == 255: * raise StopIteration # <<<<<<<<<<<<<< @@ -5703,9 +5645,9 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_14__next__(struct __pyx_obj_4kol * */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - __PYX_ERR(0, 147, __pyx_L1_error) + __PYX_ERR(0, 151, __pyx_L1_error) - /* "kola/parser.pyx":146 + /* "kola/parser.pyx":150 * def __next__(self): * ret = self.exec_once() * if self.stat == 255: # <<<<<<<<<<<<<< @@ -5714,7 +5656,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_14__next__(struct __pyx_obj_4kol */ } - /* "kola/parser.pyx":148 + /* "kola/parser.pyx":152 * if self.stat == 255: * raise StopIteration * return ret # <<<<<<<<<<<<<< @@ -5726,7 +5668,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_14__next__(struct __pyx_obj_4kol __pyx_r = __pyx_v_ret; goto __pyx_L0; - /* "kola/parser.pyx":144 + /* "kola/parser.pyx":148 * return self * * def __next__(self): # <<<<<<<<<<<<<< @@ -5746,7 +5688,7 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_14__next__(struct __pyx_obj_4kol return __pyx_r; } -/* "kola/parser.pyx":150 +/* "kola/parser.pyx":154 * return ret * * def __repr__(self): # <<<<<<<<<<<<<< @@ -5776,19 +5718,19 @@ static PyObject *__pyx_pf_4kola_6parser_6Parser_16__repr__(struct __pyx_obj_4kol int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "kola/parser.pyx":151 + /* "kola/parser.pyx":155 * * def __repr__(self): * return PyUnicode_FromFormat("", self.lexer._filename) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyUnicode_FromFormat(((char const *)""), __pyx_v_self->lexer->_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_1 = PyUnicode_FromFormat(((char const *)""), __pyx_v_self->lexer->_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "kola/parser.pyx":150 + /* "kola/parser.pyx":154 * return ret * * def __repr__(self): # <<<<<<<<<<<<<< @@ -7277,7 +7219,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_KoiLangCommandError, sizeof(__pyx_k_KoiLangCommandError), 0, 0, 1, 1}, {0, __pyx_k_KoiLangError, sizeof(__pyx_k_KoiLangError), 0, 0, 1, 1}, {0, __pyx_k_KoiLangSyntaxError, sizeof(__pyx_k_KoiLangSyntaxError), 0, 0, 1, 1}, - {0, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0}, {0, __pyx_k_Parser, sizeof(__pyx_k_Parser), 0, 0, 1, 1}, {0, __pyx_k_Parser___reduce_cython, sizeof(__pyx_k_Parser___reduce_cython), 0, 0, 1, 1}, {0, __pyx_k_Parser___setstate_cython, sizeof(__pyx_k_Parser___setstate_cython), 0, 0, 1, 1}, @@ -7288,12 +7229,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_Parser_push, sizeof(__pyx_k_Parser_push), 0, 0, 1, 1}, {0, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {0, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, - {0, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1}, - {0, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, - {0, __pyx_k_an_error_occured_during_handling, sizeof(__pyx_k_an_error_occured_during_handling), 0, 1, 0, 0}, + {0, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 1}, {0, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {0, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {0, __pyx_k_command, sizeof(__pyx_k_command), 0, 1, 0, 0}, {0, __pyx_k_command_set, sizeof(__pyx_k_command_set), 0, 0, 1, 1}, {0, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {0, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, @@ -7314,7 +7252,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {0, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {0, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, - {0, __pyx_k_not_found, sizeof(__pyx_k_not_found), 0, 1, 0, 0}, {0, __pyx_k_number, sizeof(__pyx_k_number), 0, 1, 0, 0}, {0, __pyx_k_parse_args, sizeof(__pyx_k_parse_args), 0, 0, 1, 1}, {0, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, @@ -7346,7 +7283,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_KoiLangCommandError, __pyx_k_KoiLangCommandError, sizeof(__pyx_k_KoiLangCommandError), 0, 0, 1, 1}, {&__pyx_n_s_KoiLangError, __pyx_k_KoiLangError, sizeof(__pyx_k_KoiLangError), 0, 0, 1, 1}, {&__pyx_n_s_KoiLangSyntaxError, __pyx_k_KoiLangSyntaxError, sizeof(__pyx_k_KoiLangSyntaxError), 0, 0, 1, 1}, - {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0}, {&__pyx_n_s_Parser, __pyx_k_Parser, sizeof(__pyx_k_Parser), 0, 0, 1, 1}, {&__pyx_n_s_Parser___reduce_cython, __pyx_k_Parser___reduce_cython, sizeof(__pyx_k_Parser___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Parser___setstate_cython, __pyx_k_Parser___setstate_cython, sizeof(__pyx_k_Parser___setstate_cython), 0, 0, 1, 1}, @@ -7357,12 +7293,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_Parser_push, __pyx_k_Parser_push, sizeof(__pyx_k_Parser_push), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, - {&__pyx_n_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, - {&__pyx_kp_u_an_error_occured_during_handling, __pyx_k_an_error_occured_during_handling, sizeof(__pyx_k_an_error_occured_during_handling), 0, 1, 0, 0}, + {&__pyx_n_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_kp_u_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 1, 0, 0}, {&__pyx_n_s_command_set, __pyx_k_command_set, sizeof(__pyx_k_command_set), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, @@ -7383,7 +7316,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, - {&__pyx_kp_u_not_found, __pyx_k_not_found, sizeof(__pyx_k_not_found), 0, 1, 0, 0}, {&__pyx_kp_u_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 1, 0, 0}, {&__pyx_n_s_parse_args, __pyx_k_parse_args, sizeof(__pyx_k_parse_args), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, @@ -7413,8 +7345,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { }; /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 151, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -7432,10 +7364,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * n.next = self.stack_top * self.stack_top = n */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_push, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_push, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 9, __pyx_L1_error) /* "kola/parser.pyx":13 * self.stack_top = n @@ -7444,47 +7376,47 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef Token n = self.stack_top * if n is None: */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_pop, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_pop, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 13, __pyx_L1_error) - /* "kola/parser.pyx":34 + /* "kola/parser.pyx":35 * self.lexer._filename, lineno, text) * * cpdef tuple parse_args(self): # <<<<<<<<<<<<<< * cdef: * uint8_t stat = 1, action = 0 */ - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_parse_args, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_parse_args, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 35, __pyx_L1_error) - /* "kola/parser.pyx":98 + /* "kola/parser.pyx":99 * return tuple(args), kwds * * cpdef object exec_once(self): # <<<<<<<<<<<<<< * cdef: * str name */ - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_exec_once, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_exec_once, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 99, __pyx_L1_error) - /* "kola/parser.pyx":136 - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e + /* "kola/parser.pyx":140 + * * * cpdef void exec_(self) except *: # <<<<<<<<<<<<<< * self.exec_once() * while not self.t_cache is None: */ - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_exec, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_kola_parser_pyx, __pyx_n_s_exec, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 140, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: @@ -7492,20 +7424,20 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Parser__set_state(self, __pyx_state) */ - __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_Parser(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_tuple__14 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Parser, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Parser, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7522,68 +7454,63 @@ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { if (__Pyx_InitString(__pyx_string_tab[3], &__pyx_n_s_KoiLangCommandError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); if (__Pyx_InitString(__pyx_string_tab[4], &__pyx_n_s_KoiLangError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); if (__Pyx_InitString(__pyx_string_tab[5], &__pyx_n_s_KoiLangSyntaxError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_kp_u_None) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_n_s_Parser) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_n_s_Parser___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_n_s_Parser___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_n_s_Parser_exec) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_n_s_Parser_exec_once) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_n_s_Parser_parse_args) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_Parser_pop) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_Parser_push) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_n_s_PickleError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_n_s_StopIteration) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_n_s__16) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_kp_u__2) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_kp_u_an_error_occured_during_handling) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_kp_u_command) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_n_s_command_set) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_n_s_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_n_s_dict_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[26], &__pyx_kp_u_disable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[27], &__pyx_kp_u_enable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[28], &__pyx_n_s_exception) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[29], &__pyx_n_s_exec) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[30], &__pyx_n_s_exec_once) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[31], &__pyx_kp_u_gc) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[32], &__pyx_n_s_getstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[33], &__pyx_n_s_import) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[34], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[35], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[36], &__pyx_n_s_kola_parser) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[37], &__pyx_kp_s_kola_parser_pyx) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[38], &__pyx_n_s_lexer) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[39], &__pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[40], &__pyx_n_s_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[41], &__pyx_n_s_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[42], &__pyx_n_s_new) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[43], &__pyx_kp_u_not_found) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[44], &__pyx_kp_u_number) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[45], &__pyx_n_s_parse_args) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[46], &__pyx_n_s_pickle) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[47], &__pyx_n_s_pop) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[48], &__pyx_n_s_push) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[49], &__pyx_n_s_pyx_PickleError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[50], &__pyx_n_s_pyx_checksum) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[51], &__pyx_n_s_pyx_result) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[52], &__pyx_n_s_pyx_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[53], &__pyx_n_s_pyx_type) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[54], &__pyx_n_s_pyx_unpickle_Parser) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[55], &__pyx_n_s_pyx_vtable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[56], &__pyx_n_s_reduce) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[57], &__pyx_n_s_reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[58], &__pyx_n_s_reduce_ex) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[59], &__pyx_n_s_self) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[60], &__pyx_n_s_setstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[61], &__pyx_n_s_setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[62], &__pyx_n_s_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[63], &__pyx_kp_s_stringsource) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[64], &__pyx_n_s_test) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[65], &__pyx_kp_u_text) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[66], &__pyx_n_s_update) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - if (__Pyx_InitString(__pyx_string_tab[67], &__pyx_n_s_use_setstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_n_s_Parser) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_n_s_Parser___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_n_s_Parser___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_n_s_Parser_exec) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_n_s_Parser_exec_once) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_n_s_Parser_parse_args) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_n_s_Parser_pop) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_Parser_push) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_PickleError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_n_s_StopIteration) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_n_s__15) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_n_s_command_set) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_n_s_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_n_s_dict_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_kp_u_disable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_kp_u_enable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_n_s_exception) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_n_s_exec) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[26], &__pyx_n_s_exec_once) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[27], &__pyx_kp_u_gc) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[28], &__pyx_n_s_getstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[29], &__pyx_n_s_import) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[30], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[31], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[32], &__pyx_n_s_kola_parser) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[33], &__pyx_kp_s_kola_parser_pyx) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[34], &__pyx_n_s_lexer) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[35], &__pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[36], &__pyx_n_s_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[37], &__pyx_n_s_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[38], &__pyx_n_s_new) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[39], &__pyx_kp_u_number) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[40], &__pyx_n_s_parse_args) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[41], &__pyx_n_s_pickle) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[42], &__pyx_n_s_pop) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[43], &__pyx_n_s_push) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[44], &__pyx_n_s_pyx_PickleError) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[45], &__pyx_n_s_pyx_checksum) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[46], &__pyx_n_s_pyx_result) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[47], &__pyx_n_s_pyx_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[48], &__pyx_n_s_pyx_type) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[49], &__pyx_n_s_pyx_unpickle_Parser) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[50], &__pyx_n_s_pyx_vtable) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[51], &__pyx_n_s_reduce) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[52], &__pyx_n_s_reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[53], &__pyx_n_s_reduce_ex) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[54], &__pyx_n_s_self) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[55], &__pyx_n_s_setstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[56], &__pyx_n_s_setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[57], &__pyx_n_s_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[58], &__pyx_kp_s_stringsource) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[59], &__pyx_n_s_test) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[60], &__pyx_kp_u_text) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[61], &__pyx_n_s_update) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (__Pyx_InitString(__pyx_string_tab[62], &__pyx_n_s_use_setstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error); #endif #if !CYTHON_USE_MODULE_STATE if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); @@ -8067,7 +7994,7 @@ if (!__Pyx_RefNanny) { * n.next = self.stack_top * self.stack_top = n */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_3push, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_push, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_3push, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_push, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_push, __pyx_t_3) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8080,48 +8007,48 @@ if (!__Pyx_RefNanny) { * cdef Token n = self.stack_top * if n is None: */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_5pop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_pop, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_5pop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_pop, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_pop, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4kola_6parser_Parser); - /* "kola/parser.pyx":34 + /* "kola/parser.pyx":35 * self.lexer._filename, lineno, text) * * cpdef tuple parse_args(self): # <<<<<<<<<<<<<< * cdef: * uint8_t stat = 1, action = 0 */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_7parse_args, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_parse_args, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_7parse_args, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_parse_args, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_parse_args, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_parse_args, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4kola_6parser_Parser); - /* "kola/parser.pyx":98 + /* "kola/parser.pyx":99 * return tuple(args), kwds * * cpdef object exec_once(self): # <<<<<<<<<<<<<< * cdef: * str name */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_9exec_once, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_exec_once, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_9exec_once, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_exec_once, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_exec_once, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_exec_once, __pyx_t_3) < 0) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4kola_6parser_Parser); - /* "kola/parser.pyx":136 - * raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e + /* "kola/parser.pyx":140 + * * * cpdef void exec_(self) except *: # <<<<<<<<<<<<<< * self.exec_once() * while not self.t_cache is None: */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_11exec_, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_exec, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_11exec_, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser_exec, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_exec, __pyx_t_3) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_exec, __pyx_t_3) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_4kola_6parser_Parser); @@ -8130,7 +8057,7 @@ if (!__Pyx_RefNanny) { * cdef tuple state * cdef object _dict */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser___reduce_cython, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser___reduce_cython, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8142,7 +8069,7 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Parser__set_state(self, __pyx_state) */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser___setstate_cython, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_6Parser_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser___setstate_cython, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_4kola_6parser_Parser->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8153,7 +8080,7 @@ if (!__Pyx_RefNanny) { * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_1__pyx_unpickle_Parser, 0, __pyx_n_s_pyx_unpickle_Parser, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4kola_6parser_1__pyx_unpickle_Parser, 0, __pyx_n_s_pyx_unpickle_Parser, NULL, __pyx_n_s_kola_parser, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Parser, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9417,83 +9344,160 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) return -1; } -/* PyUnicode_Unicode */ -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { - if (unlikely(obj == Py_None)) - obj = __pyx_kp_u_None; - return __Pyx_NewRef(obj); -} - -/* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char) { -#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyObject *result_uval; - int result_ukind, kind_shift; - Py_ssize_t i, char_pos; - void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED - result_uval = PyUnicode_New(result_ulength, max_char); - if (unlikely(!result_uval)) return NULL; - result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; - kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; - result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif - assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); - char_pos = 0; - for (i=0; i < value_count; i++) { - int ukind; - Py_ssize_t ulength; - void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) - goto bad; - ulength = __Pyx_PyUnicode_GET_LENGTH(uval); - if (unlikely(!ulength)) - continue; - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) - goto overflow; - ukind = __Pyx_PyUnicode_KIND(uval); - udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { - memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); - } else { - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) - _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); - #else - Py_ssize_t j; - for (j=0; j < ulength; j++) { - Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); - __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); - } - #endif - } - char_pos += ulength; +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; } - return result_uval; -overflow: - PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); -bad: - Py_DECREF(result_uval); - return NULL; -#else - CYTHON_UNUSED_VAR(max_char); - CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); -#endif + return b == &PyBaseObject_Type; } - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; iexc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); @@ -9650,157 +9654,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif -/* FastTypeChecks */ -#if CYTHON_COMPILING_IN_CPYTHON -static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { - while (a) { - a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); - if (a == b) - return 1; - } - return b == &PyBaseObject_Type; -} -static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (a == b) return 1; - mro = a->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(a, b); -} -static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { - PyObject *mro; - if (cls == a || cls == b) return 1; - mro = cls->tp_mro; - if (likely(mro)) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(mro); - for (i = 0; i < n; i++) { - PyObject *base = PyTuple_GET_ITEM(mro, i); - if (base == (PyObject *)a || base == (PyObject *)b) - return 1; - } - return 0; - } - return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); -} -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else -static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { - if (exc_type1) { - return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); - } else { - return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); - } -} -#endif -static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - assert(PyExceptionClass_Check(exc_type)); - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; iexc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = *type; - exc_info->exc_value = *value; - exc_info->exc_traceback = *tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; - #endif - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#else -static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); - PyErr_SetExcInfo(*type, *value, *tb); - *type = tmp_type; - *value = tmp_value; - *tb = tmp_tb; -} -#endif - /* GetAttr3 */ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare @@ -9907,7 +9760,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -12348,7 +12201,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__16)); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__15)); } return name; } diff --git a/kola/parser.pyx b/kola/parser.pyx index f1c674e..71e285c 100644 --- a/kola/parser.pyx +++ b/kola/parser.pyx @@ -21,11 +21,12 @@ cdef class Parser: cdef: int lineno = 1 const char* text = "" - if not self.t_cache is None: + Token cur = self.t_cache + if not cur is None: lineno = self.t_cache.lineno if errorno == 16: - errorno = (self.stat << 4) + self.t_cache.syn - text = self.t_cache.raw_val + errorno = (self.stat << 4) + cur.syn + text = cur.raw_val while not self.t_cache is None and not CMD <= self.t_cache.syn <= TEXT: self.t_cache = self.lexer.next_token() kola_set_error(KoiLangSyntaxError, errorno, @@ -124,14 +125,17 @@ cdef class Parser: try: cmd = self.command_set[name] except KeyError: - raise KoiLangCommandError(f"command '{name}' not found") from None + kola_set_errcause(KoiLangCommandError, 2, + self.lexer._filename, token.lineno, token.raw_val, None) try: return cmd(*args, **kwds) except KoiLangError: raise except Exception as e: - raise KoiLangCommandError(f"an error occured during handling command '{name}'") from e + kola_set_errcause(KoiLangCommandError, 3, + self.lexer._filename, token.lineno, token.raw_val, e) + cpdef void exec_(self) except *: self.exec_once() diff --git a/kola/version.py b/kola/version.py index 47fc159..d7c1618 100644 --- a/kola/version.py +++ b/kola/version.py @@ -1,2 +1,2 @@ -__version__ = "0.1.0b3" -version_info = (0, 1, 0, "beta", 3) \ No newline at end of file +__version__ = "0.1.0b4" +version_info = (0, 1, 0, "beta", 4) \ No newline at end of file