def node_atom(self, node):
        jsvars = self.jsvars.copy()
        items = []
        cls = None
        if node.children[0].value == '(':
            cls = jsvars['tuple']
            if len(node.children) == 3:
                items = self.dispatch(node.children[1])
                if not isinstance(items, list):
                    return items
            elif len(node.children) != 2:
                self.not_implemented(node)
        elif node.children[0].value == '[':
            cls = jsvars['list']
            if len(node.children) == 3:
                items = self.dispatch(node.children[1])
                if not isinstance(items, list):
                    if isinstance(node.children[1], Leaf):
                        items = [items]
                    elif type_repr(node.children[1].type) == 'listmaker':
                        pass
                    else:
                        items = [items]
            elif len(node.children) != 2:
                self.not_implemented(node)
        elif node.children[0].value == '{':
            cls = jsvars['dict']
            if len(node.children) == 3:
                items = self.dispatch(node.children[1])
                if not isinstance(items, dict):
                    self.not_implemented(node)
            elif len(node.children) != 2:
                self.not_implemented(node)
            if items:
                items = [(k, v) % "[%s, %s]" for k, v in items.iteritems()]
            else:
                items = []
        elif node.children[0].value == '`':
            assert len(node.children) == 3
            what = self.dispatch(node.children[1])
            jsvars.update(locals())
            return "%(builtin)s['repr'](%(what)s)" % jsvars
        elif leaf_type.get(node.children[0].type) == 'str':
            s = ''
            for child in node.children:
                assert leaf_type.get(child.type) == 'str'
                s += child.value
            return self.add_const_str(eval(s))
        else:
            self.not_implemented(node)
        if isinstance(items, list):
            items = '[%s]' % ', '.join([str(i) for i in items])
        jsvars.update(locals())
        return "%(module)s['$new'](%(cls)s, %(items)s)" % jsvars
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.node_atom/swapped operands of `%`