Bison can't detect the type of a mid-rule action, even if it accesses $<str>$, so need to create a separate rule for this.