singulat t and nil
This commit is contained in:
+13
-13
@@ -119,7 +119,7 @@ namespace Parser {
|
||||
++(*index_in_text);
|
||||
++parser_col;
|
||||
String* str_keyword = read_atom(text, index_in_text);
|
||||
Lisp_Object* ret = Memory::create_lisp_object_keyword(str_keyword);
|
||||
Lisp_Object* ret = Memory::get_or_create_lisp_object_keyword(str_keyword);
|
||||
|
||||
inject_scl(ret);
|
||||
return ret;
|
||||
@@ -128,7 +128,7 @@ namespace Parser {
|
||||
proc parse_symbol(char* text, int* index_in_text) -> Lisp_Object* {
|
||||
// we are now at the first char of the symbol
|
||||
String* str_symbol = read_atom(text, index_in_text);
|
||||
Lisp_Object* ret = Memory::create_lisp_object_symbol(str_symbol);
|
||||
Lisp_Object* ret = Memory::get_or_create_lisp_object_symbol(str_symbol);
|
||||
inject_scl(ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -243,16 +243,16 @@ namespace Parser {
|
||||
|
||||
if (quoteType == '\'')
|
||||
return Memory::create_lisp_object_pair(
|
||||
Memory::create_lisp_object_symbol("quote"),
|
||||
Memory::create_lisp_object_pair(result, Memory::create_lisp_object_nil()));
|
||||
Memory::get_or_create_lisp_object_symbol("quote"),
|
||||
Memory::create_lisp_object_pair(result, Memory::nil));
|
||||
else if (quoteType == '`')
|
||||
return Memory::create_lisp_object_pair(
|
||||
Memory::create_lisp_object_symbol("quasiquote"),
|
||||
Memory::create_lisp_object_pair(result, Memory::create_lisp_object_nil()));
|
||||
Memory::get_or_create_lisp_object_symbol("quasiquote"),
|
||||
Memory::create_lisp_object_pair(result, Memory::nil));
|
||||
// it has to be an unquote
|
||||
return Memory::create_lisp_object_pair(
|
||||
Memory::create_lisp_object_symbol("unquote"),
|
||||
Memory::create_lisp_object_pair(result, Memory::create_lisp_object_nil()));
|
||||
Memory::get_or_create_lisp_object_symbol("unquote"),
|
||||
Memory::create_lisp_object_pair(result, Memory::nil));
|
||||
}
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace Parser {
|
||||
if (text[(*index_in_text)] == ')') {
|
||||
++(*index_in_text);
|
||||
++parser_col;
|
||||
return Memory::create_lisp_object_nil();
|
||||
return Memory::nil;
|
||||
}
|
||||
|
||||
// okay there is something
|
||||
@@ -299,7 +299,7 @@ namespace Parser {
|
||||
|
||||
|
||||
if (text[(*index_in_text)] == ')') {
|
||||
head->value.pair->rest = Memory::create_lisp_object_nil();
|
||||
head->value.pair->rest = Memory::nil;
|
||||
++parser_col;
|
||||
++(*index_in_text);
|
||||
break;
|
||||
@@ -384,7 +384,7 @@ namespace Parser {
|
||||
// we are now in the function body, just wrap it in an
|
||||
// implicit prog
|
||||
function->body = Memory::create_lisp_object_pair(
|
||||
Memory::create_lisp_object_symbol("prog"),
|
||||
Memory::get_or_create_lisp_object_symbol("prog"),
|
||||
arguments);
|
||||
|
||||
Lisp_Object* macro = Memory::create_lisp_object();
|
||||
@@ -393,7 +393,7 @@ namespace Parser {
|
||||
define_symbol(symbol_for_macro, macro, environment_for_macros);
|
||||
|
||||
// print_environment(environment_for_macros);
|
||||
return Memory::create_lisp_object_nil();
|
||||
return Memory::nil;
|
||||
|
||||
} else if (string_equal("delete-syntax", expression->value.pair->first->value.symbol->identifier)) {
|
||||
/* --- deleting an existing macro --- */
|
||||
@@ -449,7 +449,7 @@ namespace Parser {
|
||||
Lisp_Object* result;
|
||||
eat_until_code(text, &index_in_text);
|
||||
if (text[(index_in_text)] == '\0')
|
||||
return Memory::create_lisp_object_nil();
|
||||
return Memory::nil;
|
||||
if (text[index_in_text] == '(' ||
|
||||
text[index_in_text] == '\'' ||
|
||||
text[index_in_text] == '`' ||
|
||||
|
||||
Reference in New Issue
Block a user