From 118161f46b8219f52779ee5a8dfc632a8964e3c0 Mon Sep 17 00:00:00 2001
From: Holger Freyther <ich@tamarin.(none)>
Date: Tue, 19 May 2009 09:37:07 +0200
Subject: bitbake: [parser] Call eval immeditaley to test this code

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
---
 bitbake/lib/bb/parse/ast.py | 37 ++++---------------------------------
 1 file changed, 4 insertions(+), 33 deletions(-)

(limited to 'bitbake')

diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 26bd7236c..a995b9d3e 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -26,12 +26,6 @@ import bb, re, string
 __word__ = re.compile(r"\S+")
 __parsed_methods__ = bb.methodpool.get_parsed_dict()
 
-def getFunc(groupd, key, data):
-    if 'flag' in groupd and groupd['flag'] != None:
-        return bb.data.getVarFlag(key, groupd['flag'], data)
-    else:
-        return bb.data.getVar(key, data)
-
 class StatementGroup:
     def __init__(self):
         self.statements = []
@@ -45,6 +39,9 @@ class StatementGroup:
         """
         map(lambda x: x.eval(data), self.statements)
 
+    def __getitem__(self, item):
+        return self.statements.__getitem__(item)
+
 class IncludeNode:
     def __init__(self, what_file, fn, lineno, force):
         self.what_file = what_file
@@ -140,33 +137,7 @@ def handleExport(statements, m, data):
 def handleData(statements, groupd, data):
     # AST handling
     statements.append(DataNode(groupd))
-
-    key = groupd["var"]
-    if "exp" in groupd and groupd["exp"] != None:
-        bb.data.setVarFlag(key, "export", 1, data)
-    if "ques" in groupd and groupd["ques"] != None:
-        val = getFunc(groupd, key, data)
-        if val == None:
-            val = groupd["value"]
-    elif "colon" in groupd and groupd["colon"] != None:
-        e = data.createCopy()
-        bb.data.update_data(e)
-        val = bb.data.expand(groupd["value"], e)
-    elif "append" in groupd and groupd["append"] != None:
-        val = "%s %s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
-    elif "prepend" in groupd and groupd["prepend"] != None:
-        val = "%s %s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
-    elif "postdot" in groupd and groupd["postdot"] != None:
-        val = "%s%s" % ((getFunc(groupd, key, data) or ""), groupd["value"])
-    elif "predot" in groupd and groupd["predot"] != None:
-        val = "%s%s" % (groupd["value"], (getFunc(groupd, key, data) or ""))
-    else:
-        val = groupd["value"]
-    if 'flag' in groupd and groupd['flag'] != None:
-        bb.msg.debug(3, bb.msg.domain.Parsing, "setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val))
-        bb.data.setVarFlag(key, groupd['flag'], val, data)
-    else:
-        bb.data.setVar(key, val, data)
+    statements[-1].eval(data)
 
 def handleMethod(statements, func_name, lineno, fn, body, d):
     if func_name == "__anonymous":
-- 
cgit v1.2.3