summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-12-29 04:15:48 +0100
committerClifford Wolf <clifford@clifford.at>2014-12-29 04:23:19 +0100
commit33e25394b447eda249cc9cf7c114093f3069fb62 (patch)
treeccc935ec29430831a8d4fc71826fe5716755eec3 /kernel
parent7d843adef98ec051acc64f4a04c925c468b562c2 (diff)
Fixed comment parsing in Pass::call()
Diffstat (limited to 'kernel')
-rw-r--r--kernel/register.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/register.cc b/kernel/register.cc
index 7086e142..56dc695a 100644
--- a/kernel/register.cc
+++ b/kernel/register.cc
@@ -150,7 +150,7 @@ void Pass::call(RTLIL::Design *design, std::string command)
std::string cmd_buf = command;
std::string tok = next_token(cmd_buf, " \t\r\n");
- if (tok.empty() || tok[0] == '#')
+ if (tok.empty())
return;
if (tok[0] == '!') {
@@ -166,8 +166,13 @@ void Pass::call(RTLIL::Design *design, std::string command)
}
while (!tok.empty()) {
- if (tok == "#")
- break;
+ if (tok == "#") {
+ int stop;
+ for (stop = 0; stop < GetSize(cmd_buf); stop++)
+ if (cmd_buf[stop] == '\r' || cmd_buf[stop] == '\n')
+ break;
+ cmd_buf = cmd_buf.substr(stop);
+ } else
if (tok.back() == ';') {
int num_semikolon = 0;
while (!tok.empty() && tok.back() == ';')