Explorar el Código

Fixed annoying error log in tests

master
Felix Brendel hace 7 años
padre
commit
75c95d3baa
Se han modificado 3 ficheros con 5 adiciones y 3 borrados
  1. +2
    -1
      src/error.cpp
  2. +2
    -1
      src/eval.cpp
  3. +1
    -1
      src/io.cpp

+ 2
- 1
src/error.cpp Ver fichero

@@ -8,7 +8,8 @@ proc delete_error() -> void {
}

proc create_error(const char* c_file_name, int c_file_line, Lisp_Object* type, String* message) -> void {
printf("Error created in:\n%s:%d\n", c_file_name, c_file_line);
if (Globals::log_level > Log_Level::None)
printf("Error created in:\n%s:%d\n", c_file_name, c_file_line);

delete_error();
debug_break();


+ 2
- 1
src/eval.cpp Ver fichero

@@ -398,7 +398,8 @@ proc eval_expr(Lisp_Object* node, Environment* env) -> Lisp_Object* {

// check for c function
if (Memory::get_type(lispOperator) == Lisp_Object_Type::CFunction) {
Lisp_Object* result = lispOperator->value.cFunction->function(arguments, env);
Lisp_Object* result;
try result = lispOperator->value.cFunction->function(arguments, env);
return result;
}



+ 1
- 1
src/io.cpp Ver fichero

@@ -109,7 +109,7 @@ proc read_entire_file(char* filename) -> char* {
size_t newLen = fread(fileContent, sizeof(char), bufsize, fp);

fileContent[newLen] = '\0';
if ( ferror( fp ) != 0 ) {
if (ferror(fp) != 0) {
fputs("Error reading file", stderr);
}
}


Cargando…
Cancelar
Guardar