diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-01-04 13:34:08 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-10 13:24:03 +0000 |
commit | b127874ee6f7b8801575a10f4b7df02783aafdeb (patch) | |
tree | d16a7aeb08cb5e41996b3d5ce68bee24a75911ba /bitbake/lib/bb/parse/parse_py | |
parent | f305e95840a887bbd97e9003e7a0f9135df77fcb (diff) | |
download | openembedded-core-b127874ee6f7b8801575a10f4b7df02783aafdeb.tar.gz openembedded-core-b127874ee6f7b8801575a10f4b7df02783aafdeb.tar.bz2 openembedded-core-b127874ee6f7b8801575a10f4b7df02783aafdeb.zip |
parse: pass filename, lineno into the ast
We will be needing this information to improve the tracebacks of python code
from the metadata, as well as to give the user information about where
variables were defined, so they know how it ended up the way it is.
(Bitbake rev: 9615c538b894f71a2d1a0ba6b3f260db91e75786)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 15 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/parse_py/ConfHandler.py | 8 |
2 files changed, 12 insertions, 11 deletions
diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 81554b9435..4a938b911c 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py @@ -172,7 +172,7 @@ def feeder(lineno, s, fn, root, statements): if __infunc__: if s == '}': __body__.append('') - ast.handleMethod(statements, __infunc__, lineno, fn, __body__) + ast.handleMethod(statements, fn, lineno, __infunc__, __body__) __infunc__ = "" __body__ = [] else: @@ -185,7 +185,8 @@ def feeder(lineno, s, fn, root, statements): __body__.append(s) return else: - ast.handlePythonMethod(statements, __inpython__, root, __body__, fn) + ast.handlePythonMethod(statements, fn, lineno, __inpython__, + root, __body__) __body__ = [] __inpython__ = False @@ -206,7 +207,7 @@ def feeder(lineno, s, fn, root, statements): m = __func_start_regexp__.match(s) if m: __infunc__ = m.group("func") or "__anonymous" - ast.handleMethodFlags(statements, __infunc__, m) + ast.handleMethodFlags(statements, fn, lineno, __infunc__, m) return m = __def_regexp__.match(s) @@ -218,22 +219,22 @@ def feeder(lineno, s, fn, root, statements): m = __export_func_regexp__.match(s) if m: - ast.handleExportFuncs(statements, m, classes) + ast.handleExportFuncs(statements, fn, lineno, m, classes) return m = __addtask_regexp__.match(s) if m: - ast.handleAddTask(statements, m) + ast.handleAddTask(statements, fn, lineno, m) return m = __addhandler_regexp__.match(s) if m: - ast.handleBBHandlers(statements, m) + ast.handleBBHandlers(statements, fn, lineno, m) return m = __inherit_regexp__.match(s) if m: - ast.handleInherit(statements, m) + ast.handleInherit(statements, fn, lineno, m) return return ConfHandler.feeder(lineno, s, fn, statements) diff --git a/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/bitbake/lib/bb/parse/parse_py/ConfHandler.py index d90f5d868e..fc239a3540 100644 --- a/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/bitbake/lib/bb/parse/parse_py/ConfHandler.py @@ -113,22 +113,22 @@ def feeder(lineno, s, fn, statements): m = __config_regexp__.match(s) if m: groupd = m.groupdict() - ast.handleData(statements, groupd) + ast.handleData(statements, fn, lineno, groupd) return m = __include_regexp__.match(s) if m: - ast.handleInclude(statements, m, fn, lineno, False) + ast.handleInclude(statements, fn, lineno, m, False) return m = __require_regexp__.match(s) if m: - ast.handleInclude(statements, m, fn, lineno, True) + ast.handleInclude(statements, fn, lineno, m, True) return m = __export_regexp__.match(s) if m: - ast.handleExport(statements, m) + ast.handleExport(statements, fn, lineno, m) return raise ParseError("%s:%d: unparsed line: '%s'" % (fn, lineno, s)); |