From 34b2f2ee5b136555dfbf26adba8cd61fb9704a19 Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Thu, 27 Dec 2012 23:44:33 -0500 Subject: [PATCH] Revert "adding dot-notation" This reverts commit a0ea3ffb8f9f7bde6c7f28a8d4eb389c33c896de. --- hy/compiler/ast27.py | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/hy/compiler/ast27.py b/hy/compiler/ast27.py index cab102b..3d8a42f 100644 --- a/hy/compiler/ast27.py +++ b/hy/compiler/ast27.py @@ -135,10 +135,6 @@ class AST27Converter(object): "for": self._ast_for, "kwapply": self._ast_kwapply, } - - self.starts_with = { - ".": self._ast_dot_fnc - } self.in_fn = False def _def(self, node): @@ -154,30 +150,6 @@ class AST27Converter(object): ) return ret - def _ast_dot_fnc(self, node): - i = node.get_invocation() - fn = i['function'][1:] - args = i['args'] - attr = args.pop(0) - val = self.render(attr) - - a = [] - for arg in args: - a.append(self.render(arg)) - - return ast.Call( - func=ast.Attribute( - value=val, - attr=fn, - ctx=ast.Load() - ), - args=a, - keywords=[], - starargs=None, - kwargs=None - ) - - def _ast_kwapply(self, node): i = node.get_invocation() args = i['args'] @@ -202,8 +174,8 @@ class AST27Converter(object): body = body if isinstance(body, list) else [body] orel = [] - body = _adjust_body(body, do_ret=False) - orel = _adjust_body(orel, do_ret=False) + body = _adjust_body(body, do_ret=self.in_fn) + orel = _adjust_body(orel, do_ret=self.in_fn) return ast.While( test=test, @@ -334,10 +306,6 @@ class AST27Converter(object): if inv['function'] in self.native_cases: return self.native_cases[inv['function']](node) - for flag in self.starts_with: - if inv['function'].startswith(flag): - return self.starts_with[flag](node) - c = [] for child in node.get_children(): c.append(self.render(child))