summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/ast.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r--bitbake/lib/bb/parse/ast.py44
1 files changed, 13 insertions, 31 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index ed9c689afa..646a5b8d8e 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -56,13 +56,11 @@ class IncludeNode:
56 s = bb.data.expand(self.what_file, data) 56 s = bb.data.expand(self.what_file, data)
57 bb.msg.debug(3, bb.msg.domain.Parsing, "CONF %s:%d: including %s" % (self.from_fn, self.from_lineno, s)) 57 bb.msg.debug(3, bb.msg.domain.Parsing, "CONF %s:%d: including %s" % (self.from_fn, self.from_lineno, s))
58 58
59 # TODO: Cache those includes... 59 # TODO: Cache those includes... maybe not here though
60 statements = StatementGroup()
61 if self.force: 60 if self.force:
62 bb.parse.ConfHandler.include(statements, self.from_fn, s, data, "include required") 61 bb.parse.ConfHandler.include(self.from_fn, s, data, "include required")
63 else: 62 else:
64 bb.parse.ConfHandler.include(statements, self.from_fn, s, data, False) 63 bb.parse.ConfHandler.include(self.from_fn, s, data, False)
65 #statements.eval(data)
66 64
67class ExportNode: 65class ExportNode:
68 def __init__(self, var): 66 def __init__(self, var):
@@ -256,43 +254,30 @@ class InheritNode:
256 self.n = __word__.findall(files) 254 self.n = __word__.findall(files)
257 255
258 def eval(self, data): 256 def eval(self, data):
259 statements = StatementGroup() 257 bb.parse.BBHandler.inherit(self.n, data)
260 bb.parse.BBHandler.inherit(statements, self.n, data)
261 258
262def handleInclude(statements, m, fn, lineno, data, force): 259def handleInclude(statements, m, fn, lineno, force):
263 # AST handling
264 statements.append(IncludeNode(m.group(1), fn, lineno, force)) 260 statements.append(IncludeNode(m.group(1), fn, lineno, force))
265 statements[-1].eval(data)
266 261
267def handleExport(statements, m, data): 262def handleExport(statements, m):
268 # AST handling
269 statements.append(ExportNode(m.group(1))) 263 statements.append(ExportNode(m.group(1)))
270 statements[-1].eval(data)
271 264
272def handleData(statements, groupd, data): 265def handleData(statements, groupd):
273 # AST handling
274 statements.append(DataNode(groupd)) 266 statements.append(DataNode(groupd))
275 statements[-1].eval(data)
276 267
277def handleMethod(statements, func_name, lineno, fn, body, d): 268def handleMethod(statements, func_name, lineno, fn, body):
278 # AST handling
279 statements.append(MethodNode(func_name, body, lineno, fn)) 269 statements.append(MethodNode(func_name, body, lineno, fn))
280 statements[-1].eval(d)
281 270
282def handlePythonMethod(statements, root, body, fn): 271def handlePythonMethod(statements, root, body, fn):
283 # AST handling
284 statements.append(PythonMethodNode(root, body, fn)) 272 statements.append(PythonMethodNode(root, body, fn))
285 statements[-1].eval(None)
286 273
287def handleMethodFlags(statements, key, m, d): 274def handleMethodFlags(statements, key, m):
288 statements.append(MethodFlagsNode(key, m)) 275 statements.append(MethodFlagsNode(key, m))
289 statements[-1].eval(d)
290 276
291def handleExportFuncs(statements, m, classes, d): 277def handleExportFuncs(statements, m, classes):
292 statements.append(ExportFuncsNode(m.group(1), classes)) 278 statements.append(ExportFuncsNode(m.group(1), classes))
293 statements[-1].eval(d)
294 279
295def handleAddTask(statements, m, d): 280def handleAddTask(statements, m):
296 func = m.group("func") 281 func = m.group("func")
297 before = m.group("before") 282 before = m.group("before")
298 after = m.group("after") 283 after = m.group("after")
@@ -300,17 +285,14 @@ def handleAddTask(statements, m, d):
300 return 285 return
301 286
302 statements.append(AddTaskNode(func, before, after)) 287 statements.append(AddTaskNode(func, before, after))
303 statements[-1].eval(d)
304 288
305def handleBBHandlers(statements, m, d): 289def handleBBHandlers(statements, m):
306 statements.append(BBHandlerNode(m.group(1))) 290 statements.append(BBHandlerNode(m.group(1)))
307 statements[-1].eval(d)
308 291
309def handleInherit(statements, m, d): 292def handleInherit(statements, m):
310 files = m.group(1) 293 files = m.group(1)
311 n = __word__.findall(files) 294 n = __word__.findall(files)
312 statements.append(InheritNode(m.group(1))) 295 statements.append(InheritNode(m.group(1)))
313 statements[-1].eval(d)
314 296
315def finalise(fn, d): 297def finalise(fn, d):
316 bb.data.expandKeys(d) 298 bb.data.expandKeys(d)