pyrser/type_system/to_fmt.py
def to_fmt(self) -> fmt.indentable:
    """
    Return an Fmt representation for pretty-printing
    """
    qual = "scope"
    txt = fmt.sep(" ", [qual])
    name = self.show_name()
    if name != "":
        txt.lsdata.append(name)
    if len(self._hsig) > 0 or len(self.mapTypeTranslate) > 0:
        lsb = []
        if len(self.mapTypeTranslate) > 0:
            lsb.append("translate:\n")
            lsb.append(fmt.end("\n", self.mapTypeTranslate.to_fmt()))
        for k in sorted(self._hsig.keys()):
            s = self._hsig[k]
            lsb.append(fmt.end("\n", [s.to_fmt()]))
        block = fmt.block(":\n", "", fmt.tab(lsb))
        txt.lsdata.append(block)
    return txt
def to_fmt(self) -> fmt.indentable:
    """
    Return an Fmt representation for pretty-printing
    """
    qual = "scope"
    txt = fmt.sep(" ", [qual])
    name = self.show_name()
    if name != "":
        txt.lsdata.append(name)
    if len(self._hsig) > 0 or len(self.mapTypeTranslate) > 0:
        lsb = []
        if len(self.mapTypeTranslate) > 0:
            lsb.append("translate:\n")
            lsb.append(fmt.end("\n", self.mapTypeTranslate.to_fmt()))
        for k in sorted(self._hsig.keys()):
            s = self._hsig[k]
            lsb.append(fmt.end("\n", [s.to_fmt()]))
        block = fmt.block(":\n", "", fmt.tab(lsb))
        txt.lsdata.append(block)
    return txt
def to_fmt ( self ) -> fmt . indentable : qual = "scope" txt = fmt . sep ( " " , [ qual ] ) name = self . show_name ( ) if name != "" : txt . lsdata . append ( name ) if len ( self . _hsig ) > 0 or len ( self . mapTypeTranslate ) > 0 : lsb = [ ] if len ( self . mapTypeTranslate ) > 0 : lsb . append ( "translate:\n" ) lsb . append ( fmt . end ( "\n" , self . mapTypeTranslate . to_fmt ( ) ) ) for k in sorted ( self . _hsig . keys ( ) ) : s = self . _hsig [ k ] lsb . append ( fmt . end ( "\n" , [ s . to_fmt ( ) ] ) ) block = fmt . block ( ":\n" , "" , fmt . tab ( lsb ) ) txt . lsdata . append ( block ) return txt
Return an Fmt representation for pretty-printing
Return an Fmt representation for pretty - printing