diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-08-02 20:54:35 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-08-02 20:54:35 +0200 |
commit | 2ed281af02d9d251a6d20bac9ccbd916275cc966 (patch) | |
tree | b648376d4fba34856a6251dbcf002e479c0e9ce9 /tests/scripts | |
parent | 05abbac297d3fe97d159b8468fb463d6e7a28c2b (diff) | |
download | weechat-2ed281af02d9d251a6d20bac9ccbd916275cc966.zip |
tests: use double quotes instead of simple quotes in ruby script generator
This allows to use escaped chars in strings.
Diffstat (limited to 'tests/scripts')
-rwxr-xr-x | tests/scripts/python/unparse.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/scripts/python/unparse.py b/tests/scripts/python/unparse.py index f3c1066b7..e0991292b 100755 --- a/tests/scripts/python/unparse.py +++ b/tests/scripts/python/unparse.py @@ -523,6 +523,13 @@ class UnparseRuby(UnparsePython): node.attr, ) + def _ast_constant(self, node): + """Add an AST Constant in output.""" + if isinstance(node.value, str): + self.add('"%s"' % node.s.replace('#{', '\\#{')) + else: + self.add(repr(node.s)) + def _ast_dict(self, node): """Add an AST Dict in output.""" self.add( |