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 | poky-118161f46b8219f52779ee5a8dfc632a8964e3c0.tar.gz |
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 | |||
26 | __word__ = re.compile(r"\S+") | 26 | __word__ = re.compile(r"\S+") |
27 | __parsed_methods__ = bb.methodpool.get_parsed_dict() | 27 | __parsed_methods__ = bb.methodpool.get_parsed_dict() |
28 | 28 | ||
29 | def getFunc(groupd, key, data): | ||
30 | if 'flag' in groupd and groupd['flag'] != None: | ||
31 | return bb.data.getVarFlag(key, groupd['flag'], data) | ||
32 | else: | ||
33 | return bb.data.getVar(key, data) | ||
34 | |||
35 | class StatementGroup: | 29 | class StatementGroup: |
36 | def __init__(self): | 30 | def __init__(self): |
37 | self.statements = [] | 31 | self.statements = [] |
@@ -45,6 +39,9 @@ class StatementGroup: | |||
45 | """ | 39 | """ |
46 | map(lambda x: x.eval(data), self.statements) | 40 | map(lambda x: x.eval(data), self.statements) |
47 | 41 | ||
42 | def __getitem__(self, item): | ||
43 | return self.statements.__getitem__(item) | ||
44 | |||
48 | class IncludeNode: | 45 | class IncludeNode: |
49 | def __init__(self, what_file, fn, lineno, force): | 46 | def __init__(self, what_file, fn, lineno, force): |
50 | self.what_file = what_file | 47 | self.what_file = what_file |
@@ -140,33 +137,7 @@ def handleExport(statements, m, data): | |||
140 | def handleData(statements, groupd, data): | 137 | def handleData(statements, groupd, data): |
141 | # AST handling | 138 | # AST handling |
142 | statements.append(DataNode(groupd)) | 139 | statements.append(DataNode(groupd)) |
143 | 140 | statements[-1].eval(data) | |
144 | key = groupd["var"] | ||
145 | if "exp" in groupd and groupd["exp"] != None: | ||
146 | bb.data.setVarFlag(key, "export", 1, data) | ||
147 | if "ques" in groupd and groupd["ques"] != None: | ||
148 | val = getFunc(groupd, key, data) | ||
149 | if val == None: | ||
150 | val = groupd["value"] | ||
151 | elif "colon" in groupd and groupd["colon"] != None: | ||
152 | e = data.createCopy() | ||
153 | bb.data.update_data(e) | ||
154 | val = bb.data.expand(groupd["value"], e) | ||
155 | elif "append" in groupd and groupd["append"] != None: | ||
156 | val = "%s %s" % ((getFunc(groupd, key, data) or ""), groupd["value"]) | ||
157 | elif "prepend" in groupd and groupd["prepend"] != None: | ||
158 | val = "%s %s" % (groupd["value"], (getFunc(groupd, key, data) or "")) | ||
159 | elif "postdot" in groupd and groupd["postdot"] != None: | ||
160 | val = "%s%s" % ((getFunc(groupd, key, data) or ""), groupd["value"]) | ||
161 | elif "predot" in groupd and groupd["predot"] != None: | ||
162 | val = "%s%s" % (groupd["value"], (getFunc(groupd, key, data) or "")) | ||
163 | else: | ||
164 | val = groupd["value"] | ||
165 | if 'flag' in groupd and groupd['flag'] != None: | ||
166 | bb.msg.debug(3, bb.msg.domain.Parsing, "setVarFlag(%s, %s, %s, data)" % (key, groupd['flag'], val)) | ||
167 | bb.data.setVarFlag(key, groupd['flag'], val, data) | ||
168 | else: | ||
169 | bb.data.setVar(key, val, data) | ||
170 | 141 | ||
171 | def handleMethod(statements, func_name, lineno, fn, body, d): | 142 | def handleMethod(statements, func_name, lineno, fn, body, d): |
172 | if func_name == "__anonymous": | 143 | if func_name == "__anonymous": |