mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
bitbake: [parser] Cary a Statement Node through the parsing
When parsing we will collect a number of statements that can be evaluated...The plan is to be evaluate things twice (old+new) and then compare the result, it should be the same. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
5bac3403d7
commit
4b25b519ae
@@ -49,7 +49,7 @@ def init(data):
|
||||
def supports(fn, d):
|
||||
return fn[-5:] == ".conf"
|
||||
|
||||
def include(oldfn, fn, data, error_out):
|
||||
def include(statements, oldfn, fn, data, error_out):
|
||||
"""
|
||||
|
||||
error_out If True a ParseError will be reaised if the to be included
|
||||
@@ -70,13 +70,13 @@ def include(oldfn, fn, data, error_out):
|
||||
|
||||
from bb.parse import handle
|
||||
try:
|
||||
ret = handle(fn, data, True)
|
||||
ret = handle(fn, data, True, statements)
|
||||
except IOError:
|
||||
if error_out:
|
||||
raise ParseError("Could not %(error_out)s file %(fn)s" % vars() )
|
||||
bb.msg.debug(2, bb.msg.domain.Parsing, "CONF file '%s' not found" % fn)
|
||||
|
||||
def handle(fn, data, include = 0):
|
||||
def handle(fn, data, include, statements):
|
||||
init(data)
|
||||
|
||||
if include == 0:
|
||||
@@ -103,32 +103,32 @@ def handle(fn, data, include = 0):
|
||||
s2 = f.readline()[:-1].strip()
|
||||
lineno = lineno + 1
|
||||
s = s[:-1] + s2
|
||||
feeder(lineno, s, fn, data)
|
||||
feeder(lineno, s, fn, data, statements)
|
||||
|
||||
if oldfile:
|
||||
bb.data.setVar('FILE', oldfile, data)
|
||||
return data
|
||||
|
||||
def feeder(lineno, s, fn, data):
|
||||
def feeder(lineno, s, fn, data, statements):
|
||||
m = __config_regexp__.match(s)
|
||||
if m:
|
||||
groupd = m.groupdict()
|
||||
ast.handleData(groupd, data)
|
||||
ast.handleData(statements, groupd, data)
|
||||
return
|
||||
|
||||
m = __include_regexp__.match(s)
|
||||
if m:
|
||||
ast.handleInclude(m, fn, lineno, data, False)
|
||||
ast.handleInclude(statements, m, fn, lineno, data, False)
|
||||
return
|
||||
|
||||
m = __require_regexp__.match(s)
|
||||
if m:
|
||||
ast.handleInclude(m, fn, lineno, data, True)
|
||||
ast.handleInclude(statements, m, fn, lineno, data, True)
|
||||
return
|
||||
|
||||
m = __export_regexp__.match(s)
|
||||
if m:
|
||||
ast.handleExport(m, data)
|
||||
ast.handleExport(statements, m, data)
|
||||
return
|
||||
|
||||
raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s));
|
||||
|
||||
Reference in New Issue
Block a user