piecename

If F is a set filter then
    piecename F 
operates as follows. First, F is evaluated in the current position to get a set of squares X . If X does not contain exactly one square, then the filter does not match.

Otherwise, the filter returns a one-character string denoting the name of the contents of the square in X, a character in the string "RBNQKPrbnqkp" or the underscore _.

For example, one way to check whether the previous move was a black underpromotion would be:

    piecename from == "p"
    typename to in "rnb"

This is equivalent to

    currentmove ――=

Note that unicode symbols are not returned by in piecename.