This diff adds a data formatter for libstdcpp's forward_list. Besides, it refactors the existing code by extracting the common functionality between libstdcpp forward_list and list formatters into the AbstractListSynthProvider class.
Hi Walter:) Please, could you advise what can I change/do more? As a next step, I will unify the tests across the libcxx and libstdcpp formatters.
very good start!
remove all these _abstract suffixes. They make reading harder
here you should call the method get_end_of_list_address that i mention below
don't remove this command. It's useful to know what's going on
what is this? try to come up with a better name with documentation to make this easier to understand
don't pass the is_valid_break_condition variable everywhere. It makes code more confusing. Instead, you should create a method "get_end_of_list_address" that should be overridden by each child implementation. Then you add a comment that this address is used to identify if a node traversal has reached its end
don't pass 'type' here, instead, in the constructor of the parent in line 158 pass a boolean flag 'has_prev'. That should be enough for the parent class to know if there's a prev pointer or not
similarly, pass incoming_size to the constructor, and a better name is "node_value_pointer_offset", and you add a comment explaining that lists have 1 or more pointers followed by the value
All of the requested changes are done. Please, let me know if any other corrections are needed
Much better. Just some better patterns that you could follow. Read my comments.
Besides that, now you can unify the tests across libcxx and libstdcpp
Add these comments and remove the node_value_pointer_offset, as it can be inferred from has_prev
remove this trailing space
let's better initialize this with a simpler value
remove this or do any necessary corrections here
you can delete these
instead of this, declare a method in the parent class
def updateNodes(self) ... # don't return anything
that is invoked by 'update'.