# Path: lib/robot/parsing/comments.py
# class CommentCache(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, comment):
#         self._comments.append(comment)
# 
#     def consume_with(self, function):
#         map(function, self._comments)
#         self.__init__()
# 
# class Comments(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, row):
#         if row.comments:
#             self._comments.extend(c.strip() for c in row.comments if c.strip())
# 
#     @property
#     def value(self):
#         return self._comments
# 
# Path: lib/robot/parsing/settings.py
# class Documentation(Setting):
# 
#     def _set_initial_value(self):
#         self.value = ''
# 
#     def _populate(self, value):
#         self.value = self._concat_string_with_value(self.value, value)
# 
#     def _string_value(self, value):
#         return value if isinstance(value, basestring) else ''.join(value)
# 
#     def _data_as_list(self):
#         return [self.setting_name, self.value]
# 
# class MetadataList(_DataList):
# 
#     def populate(self, name, value, comment):
#         self._add(Metadata(self._parent, name, value, comment, joined=True))


import re
from .comments import CommentCache, Comments
from .settings import Documentation, MetadataList
        else:
            self._populator.populate()
            self._populator = self._get_populator(row)
            self._consume_standalone_comments()
        self._populator.add(row)

    def _is_continuing(self, row):
        return row.is_continuing() and self._populator

    def _get_populator(self, row):
        raise NotImplementedError

    def _consume_comments(self):
        self._comment_cache.consume_with(self._populator.add)

    def _consume_standalone_comments(self):
        self._consume_comments()

    def populate(self):
        self._consume_comments()
        self._populator.populate()


class SettingTablePopulator(_TablePopulator):

    def _get_populator(self, row):
        row.handle_old_style_metadata()
        setter = self._table.get_setter(row.head)
        if not setter:
            return NullPopulator()

# Path: lib/robot/parsing/comments.py
# class CommentCache(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, comment):
#         self._comments.append(comment)
# 
#     def consume_with(self, function):
#         map(function, self._comments)
#         self.__init__()
# 
# class Comments(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, row):
#         if row.comments:
#             self._comments.extend(c.strip() for c in row.comments if c.strip())
# 
#     @property
#     def value(self):
#         return self._comments
# 
# Path: lib/robot/parsing/settings.py
# class Documentation(Setting):
# 
#     def _set_initial_value(self):
#         self.value = ''
# 
#     def _populate(self, value):
#         self.value = self._concat_string_with_value(self.value, value)
# 
#     def _string_value(self, value):
#         return value if isinstance(value, basestring) else ''.join(value)
# 
#     def _data_as_list(self):
#         return [self.setting_name, self.value]
# 
# class MetadataList(_DataList):
# 
#     def populate(self, name, value, comment):
#         self._add(Metadata(self._parent, name, value, comment, joined=True))


# Path: lib/robot/parsing/tablepopulators.py
import re
from .comments import CommentCache, Comments
from .settings import Documentation, MetadataList

        else:
            self._populator.populate()
            self._populator = self._get_populator(row)
            self._consume_standalone_comments()
        self._populator.add(row)

    def _is_continuing(self, row):
        return row.is_continuing() and self._populator

    def _get_populator(self, row):
        raise NotImplementedError

    def _consume_comments(self):
        self._comment_cache.consume_with(self._populator.add)

    def _consume_standalone_comments(self):
        self._consume_comments()

    def populate(self):
        self._consume_comments()
        self._populator.populate()


class SettingTablePopulator(_TablePopulator):

    def _get_populator(self, row):
        row.handle_old_style_metadata()
        setter = self._table.get_setter(row.head)
        if not setter:
            return NullPopulator()

        if setter.im_class is Documentation: