mirror of
https://github.com/louisrubet/rpn
synced 2024-12-26 09:58:55 +01:00
#154: interpret hash as comment begin
This commit is contained in:
parent
8a0c9d077e
commit
7cfa131511
1 changed files with 15 additions and 0 deletions
|
@ -544,6 +544,19 @@ static bool get_complex(const string& entry, program& prog, string& remaining_en
|
|||
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)
|
||||
{
|
||||
bool ret = false;
|
||||
|
@ -562,6 +575,8 @@ static bool _obj_from_string(string& entry, program& prog, string& remaining_ent
|
|||
ret = true;
|
||||
else if (get_complex(entry, prog, remaining_entry))
|
||||
ret = true;
|
||||
else if (get_comment(entry, prog, remaining_entry))
|
||||
ret = true;
|
||||
else
|
||||
// nothing, considered as an auto-evaluated symbol
|
||||
if (get_other(entry, prog, remaining_entry))
|
||||
|
|
Loading…
Reference in a new issue