Fix method that removes loop ambiguity
angelaszek opened this issue · 1 comments
Some loops have identical starting segments. When the parser encounters these segments there is an initial ambiguity in what loop the starting segment is for. We need to use what the previous loops that were processed for determining which of the ambiguous loops we are parsing.
If one of the ambiguous loops is a child loop of the previous loop that was processed then that loop is the current loop. Otherwise, if the previous loop and one of the ambiguous loops have the same parent then that is the current loop
If neither condition is satisfied then this is not the start of an actual loop and the segment will be considered as a segment in the loop we are currently processing.
There is a bug where we don't check each of the ambiguous loops first to see if any are a child loop of the previous loop. We should confirm none of the ambiguous loops satisfy that first before the other check is done.
Fixed.