Sfoglia il codice sorgente

Work transfer from laptop

master
Felix Brendel 7 anni fa
parent
commit
8429c495cb
4 ha cambiato i file con 14 aggiunte e 11 eliminazioni
  1. +2
    -2
      bin/pre.slime
  2. +4
    -7
      src/built_ins.cpp
  3. +1
    -1
      src/eval.cpp
  4. +7
    -1
      src/testing.cpp

+ 2
- 2
bin/pre.slime Vedi File

@@ -1,5 +1,5 @@
(define-syntax when (condition :rest body)
"alsdkjalsk djalksdj alksjd lakjd"
"Doc String for 'when'"
`(if ,condition ,(pair prog body) nil))

(define-syntax unless (condition :rest body)
@@ -238,4 +238,4 @@ las argument."
(eval (pair printf-quoted (extend (list :@sep (eval sep) :@end (eval end)) args))))

(define-syntax pe (expr)
`(printf ,expr "evaluates to" (eval ,expr)))
`(printf ',expr "evaluates to" ,(eval expr)))

+ 4
- 7
src/built_ins.cpp Vedi File

@@ -34,17 +34,14 @@ proc built_in_load(String* file_name, Environment* env) -> Lisp_Object* {
if (file_content) {
Lisp_Object* result = Memory::nil;
Lisp_Object_Array_List* program;
try {
program = Parser::parse_program(file_name, file_content);
}
try program = Parser::parse_program(file_name, file_content);

for (int i = 0; i < program->next_index; ++i) {
try {
result = eval_expr(program->data[i], env);
}
try result = eval_expr(program->data[i], env);
}
return result;
} else {
create_generic_error("The file '%s' was not found", file_name);
create_generic_error("The file '%s' was not found", Memory::get_c_str(file_name));
return nullptr;
}
}


+ 1
- 1
src/eval.cpp Vedi File

@@ -19,7 +19,7 @@ proc apply_arguments_to_function(Lisp_Object* arguments, Function* function) ->

String_Array_List* read_in_keywords = create_String_array_list();

if (Memory::get_type(arguments) == Lisp_Object_Type::Nil)
if (arguments == Memory::nil)
goto checks;
// keyword arguments: use all given ones and keep track of the
// added ones (array list), if end of parameters in encountered or


+ 7
- 1
src/testing.cpp Vedi File

@@ -480,14 +480,20 @@ proc test_singular_t_and_nil() -> testresult {

proc test_file(const char* file) -> testresult {
Memory::reset();
assert_no_error();

Environment* env = Memory::create_built_ins_environment();
assert_no_error();

Parser::init(env);
assert_no_error();

built_in_load(Memory::create_string("pre.slime"), env);
Lisp_Object* result = built_in_load(Memory::create_string(file), env);
assert_no_error();

Lisp_Object* result = built_in_load(Memory::create_string(file), env);
assert_no_error();

return pass;
}



Caricamento…
Annulla
Salva