mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 01:25:33 +00:00
functional backends: identifiers in c++/smtlib may not start with digits
This commit is contained in:
parent
459e6b913a
commit
b428bf4600
3 changed files with 6 additions and 6 deletions
|
@ -48,8 +48,8 @@ template<typename Id> struct CxxScope : public Functional::Scope<Id> {
|
|||
for(const char **p = reserved_keywords; *p != nullptr; p++)
|
||||
this->reserve(*p);
|
||||
}
|
||||
bool is_character_legal(char c) override {
|
||||
return isascii(c) && (isalnum(c) || c == '_' || c == '$');
|
||||
bool is_character_legal(char c, int index) override {
|
||||
return isascii(c) && (isalpha(c) || (isdigit(c) && index > 0) || c == '_' || c == '$');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -48,8 +48,8 @@ struct SmtScope : public Functional::Scope<int> {
|
|||
for(const char **p = reserved_keywords; *p != nullptr; p++)
|
||||
reserve(*p);
|
||||
}
|
||||
bool is_character_legal(char c) override {
|
||||
return isascii(c) && (isalnum(c) || strchr("~!@$%^&*_-+=<>.?/", c));
|
||||
bool is_character_legal(char c, int index) override {
|
||||
return isascii(c) && (isalpha(c) || (isdigit(c) && index > 0) || strchr("~!@$%^&*_-+=<>.?/", c));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue