Tweaks, tweaks.
This commit is contained in:
parent
56dedfa6ed
commit
7729d1c1d4
9
bin/bhython
Executable file
9
bin/bhython
Executable 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!"
|
@ -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']
|
||||||
|
Loading…
Reference in New Issue
Block a user