__classname__ = ""
classes = [ None, ]
+# We need to indicate EOF to the feeder. This code is so messy that
+# factoring it out to a close_parse_file method is out of question.
+# We will use the IN_PYTHON_EOF as an indicator to just close the method
+#
+# The two parts using it are tightly integrated anyway
+IN_PYTHON_EOF = -9999999999999
+
__parsed_methods__ = methodpool.get_parsed_dict()
def supports(fn, d):
feeder(lineno, s, fn, base_name, d)
if __inpython__:
# add a blank line to close out any python definition
- feeder(lineno + 1, "", fn, base_name, d)
+ feeder(IN_PYTHON_EOF, "", fn, base_name, d)
if ext == ".bbclass":
classes.remove(__classname__)
else:
if __inpython__:
m = __python_func_regexp__.match(s)
- if m:
+ if m and lineno != IN_PYTHON_EOF:
__body__.append(s)
return
else:
__body__ = []
__inpython__ = False
+ if lineno == IN_PYTHON_EOF:
+ return
+
# fall through
if s == '' or s[0] == '#': return # skip comments and empty lines