diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-02 10:20:20 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-31 12:41:23 +0100 |
commit | 3492bff64a809b3a2a2376b83f41e099e16d22f6 (patch) | |
tree | 5434ee1339f0fb038584a00fb14739909e570fb3 /bitbake/lib/bb/data_smart.py | |
parent | 13fdd4ae5d5709332d84427ff8e60dc9ba62974f (diff) | |
download | poky-3492bff64a809b3a2a2376b83f41e099e16d22f6.tar.gz |
bitbake: Add codeparser for parsing shell and python functions
This commit is derived from Chris Larson's checksum work, turned into a
standalone piece of code for parsing python and shell functions.
The deindent code has been replaced with code to work around indentation
for speed. The original NodeVisitor in the ast was replaced with a faster
class walk call.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 1ed04d50c3..b9d9476fd8 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -46,7 +46,7 @@ class VariableParse: | |||
46 | self.value = val | 46 | self.value = val |
47 | 47 | ||
48 | self.references = set() | 48 | self.references = set() |
49 | self.funcrefs = set() | 49 | self.execs = set() |
50 | 50 | ||
51 | def var_sub(self, match): | 51 | def var_sub(self, match): |
52 | key = match.group()[2:-1] | 52 | key = match.group()[2:-1] |
@@ -64,10 +64,10 @@ class VariableParse: | |||
64 | code = match.group()[3:-1] | 64 | code = match.group()[3:-1] |
65 | codeobj = compile(code.strip(), self.varname or "<expansion>", "eval") | 65 | codeobj = compile(code.strip(), self.varname or "<expansion>", "eval") |
66 | 66 | ||
67 | parser = bb.rptest.PythonParser() | 67 | parser = bb.codeparser.PythonParser() |
68 | parser.parse_python(code) | 68 | parser.parse_python(code) |
69 | self.references |= parser.references | 69 | self.references |= parser.references |
70 | self.funcrefs |= parser.execs | 70 | self.execs |= parser.execs |
71 | 71 | ||
72 | value = utils.better_eval(codeobj, {"d": self.d}) | 72 | value = utils.better_eval(codeobj, {"d": self.d}) |
73 | return str(value) | 73 | return str(value) |