Parrot Compiler Tools Parrot Compiler Tools #39

Traits on expression tokens can be useful here

# addition
proto sub infix:<+> 
    is looser(infix:<*>)
    is pirop('add')               # use PIR 'add'
    { ... }

# handle parentheses
proto sub circumfix:<( )>
    is equiv('term:')
    is pirop('set')               # use PIR 'set'
    { ... }
continued...
Copyright © 2007 Patrick Michaud