1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-20 10:04:48 +02:00

tests: add quotes in Lua tables

This commit is contained in:
Sébastien Helleu
2017-10-24 23:30:32 +02:00
parent a97d734d8b
commit 2b06b53a29
+1 -14
View File
@@ -565,11 +565,6 @@ class UnparseLua(UnparsePython):
'Gt': '>',
'GtE': '>=',
}
self._var_quotes = True
def _set_var_quotes(self, value):
"""Set boolean to quote variables."""
self._var_quotes = value
def _ast_binop(self, node):
"""Add an AST BinOp in output."""
@@ -590,11 +585,7 @@ class UnparseLua(UnparsePython):
self.add(
'{',
self.make_list([
[(self._set_var_quotes, False),
key,
(self._set_var_quotes, True),
'=',
value]
['[', key, ']', '=', value]
for key, value in zip(node.keys, node.values)]),
'}',
)
@@ -643,10 +634,6 @@ class UnparseLua(UnparsePython):
"""Add an AST Pass in output."""
pass
def _ast_str(self, node):
"""Add an AST Str in output."""
self.add(repr(node.s) if self._var_quotes else node.s)
class UnparseTcl(UnparsePython):
"""