Port ranges can be specified using the from:to format, both in rules directly and in variables and macros.

puertos_altos = "49152:65535"
block
pass inet from 192.168.1.1 port $puertos_altos