From 7cfa131511c9c8a1494a248edb57d3b65dc5c9bc Mon Sep 17 00:00:00 2001 From: Louis Rubet Date: Sun, 12 Aug 2018 11:19:48 +0200 Subject: [PATCH] #154: interpret hash as comment begin --- src/parse.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/parse.hpp b/src/parse.hpp index 09ac84d..6bb0234 100644 --- a/src/parse.hpp +++ b/src/parse.hpp @@ -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))