removed the need of file_name_built_ins
This commit is contained in:
@@ -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)");
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user