diff options
author | Holger Freyther <ich@tamarin.(none)> | 2009-05-19 09:37:07 +0200 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-02-15 17:07:41 +0000 |
commit | 118161f46b8219f52779ee5a8dfc632a8964e3c0 (patch) | |
tree | 746fe846348b035ea4685ac751edcaa666f87086 | |
parent | a20105868f093bf78f00fe6026db80475cfe7cc0 (diff) | |
download | openembedded-core-118161f46b8219f52779ee5a8dfc632a8964e3c0.tar.gz openembedded-core-118161f46b8219f52779ee5a8dfc632a8964e3c0.tar.bz2 openembedded-core-118161f46b8219f52779ee5a8dfc632a8964e3c0.zip |
bitbake: [parser] Call eval immeditaley to test this code
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 26bd7236c9..a995b9d3ed 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": |