浏览代码

removed the need of file_name_built_ins

master
FelixBrendel 6 年前
父节点
当前提交
9f8324d7c7
共有 4 个文件被更改,包括 11 次插入5 次删除
  1. +0
    -3
      src/built_ins.cpp
  2. +2
    -2
      src/define_macros.hpp
  3. +1
    -0
      src/forward_decls.cpp
  4. +8
    -0
      src/memory.cpp

+ 0
- 3
src/built_ins.cpp 查看文件

@@ -171,9 +171,6 @@ namespace Slime {

proc load_built_ins_into_environment() -> void* {
profile_this();
String file_name_built_ins = Memory::create_string(__FILE__);
defer_free(file_name_built_ins.data);

define_macro((call/cc fun), "TODO") {
profile_with_name("(call/cc)");



+ 2
- 2
src/define_macros.hpp 查看文件

@@ -109,7 +109,7 @@
// because the parser relys on being able to temporaily put in markers
// in the code and also it will fill out the source code location
#define _define_helper(def, docstring, type, ending) \
Parser::parser_file = file_name_built_ins; \
Parser::parser_file = Memory::create_string_no_alloc((char*)__FILE__); \
Parser::parser_line = __LINE__; \
Parser::parser_col = 0; \
auto label(params,__LINE__) = Parser::parse_single_expression(#def); \
@@ -129,7 +129,7 @@
#define define_special(def, docs) _define_helper(def, docs, Slime::C_Function_Type::cSpecial, c_body = []() -> Lisp_Object*)
#define define_macro(def, docs) _define_helper(def, docs, Slime::C_Function_Type::cMacro, c_macro_body = []() -> void)

#define in_caller_env fluid_let( \
#define in_caller_env fluid_let( \
Globals::Current_Execution.envi_stack.next_index, \
Globals::Current_Execution.envi_stack.next_index-1)



+ 1
- 0
src/forward_decls.cpp 查看文件

@@ -49,6 +49,7 @@ namespace Slime {
char* get_c_str(String);
void free_everything();
String create_string(const char*);
String create_string_no_alloc(const char*);
Lisp_Object* get_symbol(String identifier);
Lisp_Object* get_symbol(const char*);
Lisp_Object* get_keyword(String identifier);


+ 8
- 0
src/memory.cpp 查看文件

@@ -74,6 +74,14 @@ namespace Slime::Memory {

}

proc create_string_no_alloc(char* str) -> String {
String s = {
(u32)strlen(str),
str
};
return s;
}

proc create_string(const char* str, u32 len) -> String {
String s = {
len,


正在加载...
取消
保存