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* {
|
proc load_built_ins_into_environment() -> void* {
|
||||||
profile_this();
|
profile_this();
|
||||||
String file_name_built_ins = Memory::create_string(__FILE__);
|
|
||||||
defer_free(file_name_built_ins.data);
|
|
||||||
|
|
||||||
define_macro((call/cc fun), "TODO") {
|
define_macro((call/cc fun), "TODO") {
|
||||||
profile_with_name("(call/cc)");
|
profile_with_name("(call/cc)");
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
// because the parser relys on being able to temporaily put in markers
|
// 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
|
// in the code and also it will fill out the source code location
|
||||||
#define _define_helper(def, docstring, type, ending) \
|
#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_line = __LINE__; \
|
||||||
Parser::parser_col = 0; \
|
Parser::parser_col = 0; \
|
||||||
auto label(params,__LINE__) = Parser::parse_single_expression(#def); \
|
auto label(params,__LINE__) = Parser::parse_single_expression(#def); \
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ namespace Slime {
|
|||||||
char* get_c_str(String);
|
char* get_c_str(String);
|
||||||
void free_everything();
|
void free_everything();
|
||||||
String create_string(const char*);
|
String create_string(const char*);
|
||||||
|
String create_string_no_alloc(const char*);
|
||||||
Lisp_Object* get_symbol(String identifier);
|
Lisp_Object* get_symbol(String identifier);
|
||||||
Lisp_Object* get_symbol(const char*);
|
Lisp_Object* get_symbol(const char*);
|
||||||
Lisp_Object* get_keyword(String identifier);
|
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 {
|
proc create_string(const char* str, u32 len) -> String {
|
||||||
String s = {
|
String s = {
|
||||||
len,
|
len,
|
||||||
|
|||||||
Reference in New Issue
Block a user