projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bedd463
)
Synced RTLIL::unescape_id() to log_id() behavior
author
Clifford Wolf
<clifford@clifford.at>
Fri, 30 Jan 2015 21:51:16 +0000
(22:51 +0100)
committer
Clifford Wolf
<clifford@clifford.at>
Fri, 30 Jan 2015 21:51:16 +0000
(22:51 +0100)
kernel/rtlil.h
patch
|
blob
|
history
diff --git
a/kernel/rtlil.h
b/kernel/rtlil.h
index d8ebae71d8eb5d329843676f8c49c650ee1ea947..4d13897b9f5779d28913ceeca85a0839dde7c1e6 100644
(file)
--- a/
kernel/rtlil.h
+++ b/
kernel/rtlil.h
@@
-267,9
+267,15
@@
namespace RTLIL
}
static inline std::string unescape_id(std::string str) {
- if (str.size() > 1 && str[0] == '\\' && str[1] != '$')
- return str.substr(1);
- return str;
+ if (str.size() < 2)
+ return str;
+ if (str[0] != '\\')
+ return str;
+ if (str[1] == '$' || str[1] == '\\')
+ return str;
+ if (str[1] >= '0' && str[1] <= '9')
+ return str;
+ return str.substr(1);
}
static inline std::string unescape_id(RTLIL::IdString str) {