3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-10 17:58:07 +00:00

Handle quoted arguments in passes

Use `std::quoted()` from `<iomanip>` to quote/unquote pass arguments.
In order to maintain handling of (unquoted) comments and semicolons this occurs when adding the token to the arg list, rather than in the tokenization itself.
Passes no longer receive tokenized-but-raw arguments and are instead pre-unquoted.
This will cause problems for some passes (e.g. `setparam`) which rely on arguments having quotation marks for disambiguation.
In order to maintain reproducibility with `echo on`, arguments which require quoting will automatically quote (arguments which were quoted but didn't need to be will not be quoted in the echo).
This commit is contained in:
Krystine Sherwin 2025-09-24 14:20:12 +12:00
parent 0a88c159c1
commit 0ab1d6d28c
No known key found for this signature in database
3 changed files with 28 additions and 4 deletions

View file

@ -470,6 +470,10 @@ void remove_directory(std::string dirname);
bool create_directory(const std::string& dirname);
std::string escape_filename_spaces(const std::string& filename);
bool needs_quote(const std::string &s);
std::string quote(const std::string &s);
std::string unquote(const std::string &s);
YOSYS_NAMESPACE_END
#endif // YOSYS_IO_H