(self, parser, group)
return newgroup
This filter translate FieldnameNode/GtLtNode pairs into RangeNodes.
This filter translate FieldnameNode/GtLtNode pairs into RangeNodes.
This filter translate FieldnameNode / GtLtNode pairs into RangeNodes .
def do_gtlt(self, parser, group):
        """This filter translate FieldnameNode/GtLtNode pairs into RangeNodes.
        """

        fname = syntax.FieldnameNode
        newgroup = group.empty_copy()
        i = 0
        lasti = len(group) - 1
        while i < len(group):
            node = group[i]
            # If this is a GtLtNode...
            if isinstance(node, self.GtLtNode):
                # If it's not the last node in the group...
                if i < lasti:
                    prevnode = newgroup[-1]
                    nextnode = group[i + 1]
                    # If previous was a fieldname and next node has text
                    if isinstance(prevnode, fname) and nextnode.has_text:
                        # Make the next node into a range based on the symbol
                        newgroup.append(self.make_range(nextnode, node.rel))
                        # Skip the next node
                        i += 1
            else:
                # If it's not a GtLtNode, add it to the filtered group
                newgroup.append(node)
            i += 1

        return newgroup
def do_gtlt ( self , parser , group ) : fname = syntax . FieldnameNode newgroup = group . empty_copy ( ) i = 0 lasti = len ( group ) - 1 while i < len ( group ) : node = group [ i ] # If this is a GtLtNode... if isinstance ( node , self . GtLtNode ) : # If it's not the last node in the group... if i < lasti : prevnode = newgroup [ - 1 ] nextnode = group [ i + 1 ] # If previous was a fieldname and next node has text if isinstance ( prevnode , fname ) and nextnode . has_text : # Make the next node into a range based on the symbol newgroup . append ( self . make_range ( nextnode , node . rel ) ) # Skip the next node i += 1 else : # If it's not a GtLtNode, add it to the filtered group newgroup . append ( node ) i += 1 return newgroup