summaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/ast.py
diff options
context:
space:
mode:
authorHolger Freyther <ich@tamarin.(none)>2009-05-19 09:37:07 +0200
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-12 17:59:15 +0000
commit9d0895119d33898e76017d25e0944bd8eb6b12b8 (patch)
treeeb24d2935c36cda15093c333b0689a4c1920fb44 /lib/bb/parse/ast.py
parente226264a2f2426a43d3c2bbcb0cd42c21eb9964c (diff)
downloadbitbake-9d0895119d33898e76017d25e0944bd8eb6b12b8.tar.gz
[parser] Call eval immeditaley to test this code
Diffstat (limited to 'lib/bb/parse/ast.py')
-rw-r--r--lib/bb/parse/ast.py37
1 files changed, 4 insertions, 33 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 26bd7236c..a995b9d3e 100644
--- a/lib/bb/parse/ast.py
+++ b/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":