renamed prog to begin and added basics for the manual
This commit is contained in:
+14
-10
@@ -161,21 +161,25 @@ namespace Parser {
|
||||
|
||||
// okay so the first letter was not actually closing the string...
|
||||
int string_length = 0;
|
||||
while (text[*index_in_text+string_length] != '"' ||
|
||||
text[*index_in_text+string_length] == '\\')
|
||||
bool escaping = false;
|
||||
while (!(text[*index_in_text+string_length] == '"' && !escaping))
|
||||
{
|
||||
if (escaping)
|
||||
escaping = false;
|
||||
else
|
||||
if (text[*index_in_text+string_length] == '\\')
|
||||
escaping = true;
|
||||
|
||||
++string_length;
|
||||
}
|
||||
|
||||
// we found the end of the string
|
||||
text[*index_in_text+string_length] = '\0';
|
||||
|
||||
if (!unescape_string(text+(*index_in_text))) {
|
||||
create_parsing_error(
|
||||
"The string '%s' at %s:%d:%d could not be unescaped.",
|
||||
text+(*index_in_text), parser_file, parser_line, parser_col);
|
||||
return nullptr;
|
||||
}
|
||||
// NOTE(Felix): Tactic: Through unescaping the string will
|
||||
// only get shorter, so we replace it inplace and later jump
|
||||
// to the original end of the string.
|
||||
try unescape_string(text+(*index_in_text));
|
||||
|
||||
String* string = Memory::create_string("", string_length);
|
||||
|
||||
@@ -415,9 +419,9 @@ namespace Parser {
|
||||
}
|
||||
|
||||
// we are now in the function body, just wrap it in an
|
||||
// implicit prog
|
||||
// implicit begin
|
||||
try macro->value.function.body = Memory::create_lisp_object_pair(
|
||||
Memory::get_or_create_lisp_object_symbol("prog"),
|
||||
Memory::get_or_create_lisp_object_symbol("begin"),
|
||||
body);
|
||||
|
||||
// macro->value.function = function;
|
||||
|
||||
Reference in New Issue
Block a user