#include <ctype.h>
#include <stdlib.h>
#include <string.h>
-
+#include "setup.h"
#include "lispreader.h"
#define TOKEN_ERROR -1
lisp_object_t* obj = search_for (name);
if (obj)
{
+ if (!lisp_integer_p(lisp_car(obj)))
+ st_abort("LispReader expected type integer at token: ", name);
*i = lisp_integer(lisp_car(obj));
return true;
}
lisp_object_t* obj = search_for (name);
if (obj)
{
+ if (!lisp_real_p(lisp_car(obj)) && !lisp_integer_p(lisp_car(obj)))
+ st_abort("LispReader expected type real at token: ", name);
*f = lisp_real(lisp_car(obj));
return true;
}
{
while(!lisp_nil_p(obj))
{
+ if (!lisp_string_p(lisp_car(obj)))
+ st_abort("LispReader expected type string at token: ", name);
vec->push_back(lisp_string(lisp_car(obj)));
obj = lisp_cdr(obj);
}
{
while(!lisp_nil_p(obj))
{
+ if (!lisp_integer_p(lisp_car(obj)))
+ st_abort("LispReader expected type integer at token: ", name);
vec->push_back(lisp_integer(lisp_car(obj)));
obj = lisp_cdr(obj);
}
lisp_object_t* obj = search_for (name);
if (obj)
{
-
+ if (!lisp_string_p(lisp_car(obj)))
+ st_abort("LispReader expected type string at token: ", name);
*str = lisp_string(lisp_car(obj));
return true;
}
lisp_object_t* obj = search_for (name);
if (obj)
{
+ if (!lisp_boolean_p(lisp_car(obj)))
+ st_abort("LispReader expected type bool at token: ", name);
*b = lisp_boolean(lisp_car(obj));
return true;
}