diff options
author | Aman Goel <amangoel@umich.edu> | 2018-07-04 15:14:58 -0400 |
---|---|---|
committer | Aman Goel <amangoel@umich.edu> | 2018-07-04 15:14:58 -0400 |
commit | f0b1ec3e9758582bc0215e646c331e45a4e2a824 (patch) | |
tree | 2847b1045fbf06420cfdce3ccf8bae1346d8c5b3 /frontends/verilog/preproc.cc | |
parent | 6e63df6dd08fe424f46039d26f9f238ac1cb4494 (diff) | |
parent | 4d343fc1cdafe469484846051680ca0b1f948549 (diff) | |
download | yosys-f0b1ec3e9758582bc0215e646c331e45a4e2a824.tar.gz yosys-f0b1ec3e9758582bc0215e646c331e45a4e2a824.tar.bz2 yosys-f0b1ec3e9758582bc0215e646c331e45a4e2a824.zip |
Merge branch 'YosysHQ-master'
Diffstat (limited to 'frontends/verilog/preproc.cc')
-rw-r--r-- | frontends/verilog/preproc.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/frontends/verilog/preproc.cc b/frontends/verilog/preproc.cc index c43ff4e3a..dea22ee8a 100644 --- a/frontends/verilog/preproc.cc +++ b/frontends/verilog/preproc.cc @@ -183,8 +183,9 @@ static std::string next_token(bool pass_newline = false) const char *ok = "abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ$0123456789"; if (ch == '`' || strchr(ok, ch) != NULL) { + char first = ch; ch = next_char(); - if (ch == '"') { + if (first == '`' && (ch == '"' || ch == '`')) { token += ch; } else do { if (strchr(ok, ch) == NULL) { @@ -244,6 +245,7 @@ static bool try_expand_macro(std::set<std::string> &defines_with_args, args.push_back(std::string()); while (1) { + skip_spaces(); tok = next_token(true); if (tok == ")" || tok == "}" || tok == "]") level--; @@ -264,6 +266,9 @@ static bool try_expand_macro(std::set<std::string> &defines_with_args, } insert_input(defines_map[name]); return true; + } else if (tok == "``") { + // Swallow `` in macro expansion + return true; } else return false; } |