pyrser/parsing/base.py
def value(self, n: Node) -> str:
        """Return the text value of the node"""
        id_n = id(n)
        idcache = self.id_cache
        if id_n not in idcache:
            return ""
        name = idcache[id_n]
        tag_cache = self.tag_cache
        if name not in tag_cache:
            raise Exception("Incoherent tag cache")
        tag = tag_cache[name]
        k = "%d:%d" % (tag._begin, tag._end)
        valcache = self._streams[-1].value_cache
        if k not in valcache:
            valcache[k] = str(tag)
        return valcache[k]
def value(self, n: Node) -> str:
        id_n = id(n)
        idcache = self.id_cache
        if id_n not in idcache:
            return ""
        name = idcache[id_n]
        tag_cache = self.tag_cache
        if name not in tag_cache:
            raise Exception("Incoherent tag cache")
        tag = tag_cache[name]
        k = "%d:%d" % (tag._begin, tag._end)
        valcache = self._streams[-1].value_cache
        if k not in valcache:
            valcache[k] = str(tag)
        return valcache[k]
def value ( self , n : Node ) -> str : id_n = id ( n ) idcache = self . id_cache if id_n not in idcache : return "" name = idcache [ id_n ] tag_cache = self . tag_cache if name not in tag_cache : raise Exception ( "Incoherent tag cache" ) tag = tag_cache [ name ] k = "%d:%d" % ( tag . _begin , tag . _end ) valcache = self . _streams [ - 1 ] . value_cache if k not in valcache : valcache [ k ] = str ( tag ) return valcache [ k ]
Return the text value of the node
Return the text value of the node