Skip to content

Commit

Permalink
#154: interpret hash as comment begin
Browse files Browse the repository at this point in the history
  • Loading branch information
louisrubet committed Aug 12, 2018
1 parent 8a0c9d0 commit 7cfa131
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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))
Expand Down

0 comments on commit 7cfa131

Please sign in to comment.