1.1 --- a/micropython/syspython.py Fri Jul 05 17:16:07 2013 +0200
1.2 +++ b/micropython/syspython.py Fri Jul 05 18:03:54 2013 +0200
1.3 @@ -91,6 +91,15 @@
1.4
1.5 definitions = self.process_definitions(node)
1.6
1.7 + # keywords(name, ...)
1.8 +
1.9 + keywords = module.keyword_names and [
1.10 + compiler.ast.CallFunc(
1.11 + special_name("keywords"),
1.12 + [special_name(name) for name in module.keyword_names]
1.13 + )
1.14 + ] or []
1.15 +
1.16 # globalnames(name, ...)
1.17
1.18 globalnames = module.module_attribute_names() and [
1.19 @@ -113,7 +122,7 @@
1.20 self.in_main = False
1.21 self.units.pop()
1.22
1.23 - return compiler.ast.Module(node.doc, compiler.ast.Stmt(definitions + [main]))
1.24 + return compiler.ast.Module(node.doc, compiler.ast.Stmt(keywords + definitions + [main]))
1.25
1.26 # Statements.
1.27
1.28 @@ -1026,7 +1035,11 @@
1.29 )
1.30
1.31 def visitSliceobj(self, node):
1.32 - return compiler.ast.Sliceobj([self.dispatch(n) for n in node.nodes])
1.33 + return compiler.ast.CallFunc(
1.34 + special_name("apply"),
1.35 + [module_attribute("__builtins__", "slice")]
1.36 + + [self.dispatch(n) for n in node.nodes]
1.37 + )
1.38
1.39 def visitSub(self, node):
1.40 return self._visitBinary(node)