From 7729d1c1d452af9d06232479e3ffc868f2064dae Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Tue, 15 Jan 2013 20:02:10 -0500 Subject: [PATCH] Tweaks, tweaks. --- bin/bhython | 9 +++++++++ hy/compiler/ast27.py | 18 ++++++++++++++++++ setup.py | 3 ++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 bin/bhython diff --git a/bin/bhython b/bin/bhython new file mode 100755 index 0000000..075ea88 --- /dev/null +++ b/bin/bhython @@ -0,0 +1,9 @@ +#!/bin/sh +"""": +exec /usr/bin/env bpython -i $0 $@ +""" + +import hy.lang.importer +import sys + +print "Hython is now importable!" diff --git a/hy/compiler/ast27.py b/hy/compiler/ast27.py index 9cec38e..20999b5 100644 --- a/hy/compiler/ast27.py +++ b/hy/compiler/ast27.py @@ -157,6 +157,7 @@ class AST27Converter(object): "decorate_with": self._ast_decorate, "index": self._ast_index, + "set_index": self._ast_set_index, "while": self._ast_while, "doseq": self._ast_for, @@ -165,6 +166,23 @@ class AST27Converter(object): } self.in_fn = False + def _ast_set_index(self, node): + i = node.get_invocation() + c = i['args'] + val = c.pop(0) + sl = c.pop(0) + tar = c.pop(0) + + return ast.Assign( + targets=[ + _meta_ast_subscript( + self.render(val), + ast.Index(value=self.render(sl)), + ast.Store()) + ], + value=self.render(tar) + ) + def _ast_index(self, node): i = node.get_invocation() c = i['args'] diff --git a/setup.py b/setup.py index e97d251..f6b5554 100755 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ setup(**{ "url": "http://hy.pault.ag/", "platforms": ['any'], "scripts": [ - "bin/hython" + "bin/hython", + "bin/bhython" ] })