quipu mercurial repository
Revisão | 79ae5adf5ed7b1d685f4289f4d9676ca46fc0483 (tree) |
---|---|
Hora | 2020-03-25 12:26:46 |
Autor | Agustina Arzille <avarzille@rise...> |
Commiter | Agustina Arzille |
Implement the 'last-err' interface
@@ -1833,6 +1833,11 @@ | ||
1833 | 1833 | } |
1834 | 1834 | } |
1835 | 1835 | |
1836 | +static DEFBUILTIN (last_err_fct) | |
1837 | +{ | |
1838 | + qp_return (interp->last_err.value); | |
1839 | +} | |
1840 | + | |
1836 | 1841 | // Names for the builtins. |
1837 | 1842 | static const char BUILTIN_NAMES[] = |
1838 | 1843 | "%mkexc\0" |
@@ -1891,6 +1896,7 @@ | ||
1891 | 1896 | "isa\0" |
1892 | 1897 | "specform-p\0" |
1893 | 1898 | "last\0" |
1899 | + "last-err\0" | |
1894 | 1900 | "%meth-ctl\0" |
1895 | 1901 | ; |
1896 | 1902 |
@@ -1969,6 +1975,7 @@ | ||
1969 | 1975 | { isa_fct, 2, -1 }, |
1970 | 1976 | { specform_p, 1, 1 }, |
1971 | 1977 | { last_fct, 1, 1 }, |
1978 | + { last_err_fct, 0, 0 }, | |
1972 | 1979 | { p_meth_ctl, 1, -1 }, |
1973 | 1980 | }; |
1974 | 1981 |
@@ -153,6 +153,7 @@ | ||
153 | 153 | { |
154 | 154 | this->throw_frame = 0; |
155 | 155 | this->exc_raised = false; |
156 | + this->last_err.value = NIL; | |
156 | 157 | } |
157 | 158 | |
158 | 159 | void growstk (uint32_t __off); |