#154: interpret hash as comment begin

This commit is contained in:
Louis Rubet 2018-08-12 11:19:48 +02:00
parent 8a0c9d077e
commit 7cfa131511

View file

@ -544,6 +544,19 @@ static bool get_complex(const string& entry, program& prog, string& remaining_en
return ret; return ret;
} }
static bool get_comment(string& entry, program& prog, string& remaining_entry)
{
bool ret = false;
unsigned int obj_len;
int entry_len = entry.size();
if (entry_len>=1 && entry[0]=='#')
{
// entry (complete line) is ignored
ret = true;
}
return ret;
}
static bool _obj_from_string(string& entry, program& prog, string& remaining_entry) static bool _obj_from_string(string& entry, program& prog, string& remaining_entry)
{ {
bool ret = false; bool ret = false;
@ -562,6 +575,8 @@ static bool _obj_from_string(string& entry, program& prog, string& remaining_ent
ret = true; ret = true;
else if (get_complex(entry, prog, remaining_entry)) else if (get_complex(entry, prog, remaining_entry))
ret = true; ret = true;
else if (get_comment(entry, prog, remaining_entry))
ret = true;
else else
// nothing, considered as an auto-evaluated symbol // nothing, considered as an auto-evaluated symbol
if (get_other(entry, prog, remaining_entry)) if (get_other(entry, prog, remaining_entry))