Tweaks, tweaks.

This commit is contained in:
Paul Tagliamonte 2013-01-15 20:02:10 -05:00
parent 56dedfa6ed
commit 7729d1c1d4
3 changed files with 29 additions and 1 deletions

9
bin/bhython Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
"""":
exec /usr/bin/env bpython -i $0 $@
"""
import hy.lang.importer
import sys
print "Hython is now importable!"

View File

@ -157,6 +157,7 @@ class AST27Converter(object):
"decorate_with": self._ast_decorate, "decorate_with": self._ast_decorate,
"index": self._ast_index, "index": self._ast_index,
"set_index": self._ast_set_index,
"while": self._ast_while, "while": self._ast_while,
"doseq": self._ast_for, "doseq": self._ast_for,
@ -165,6 +166,23 @@ class AST27Converter(object):
} }
self.in_fn = False 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): def _ast_index(self, node):
i = node.get_invocation() i = node.get_invocation()
c = i['args'] c = i['args']

View File

@ -26,6 +26,7 @@ setup(**{
"url": "http://hy.pault.ag/", "url": "http://hy.pault.ag/",
"platforms": ['any'], "platforms": ['any'],
"scripts": [ "scripts": [
"bin/hython" "bin/hython",
"bin/bhython"
] ]
}) })