You're allowing Treetop to instantiate a syntax node in the alternation
("true" / "on") and then applying a custom extension *module* to the
resulting node. Had you instead applied the *class* to each alternate
(as follows), it works with classes. Either change to modules, or:
rule true
( "true" <TrueLiteral> / "on" <TrueLiteral> )
end
Note that in your false rule, you only apply FalseLiteral to the "off"
case,
but not to the "false" case:
rule false
"false" / "off" <FalseLiteral>
end
You need to use parentheses and a module, or apply the node type to each
alternate if you must use a class:
rule false
"false" <FalseLiteral> / "off" <FalseLiteral>
end
At some time in the past, you only could create classes, and if you
search
back in the archives, you'll see all the discussion about changing
this. I
wasn't involved with it, although I might have pulled the patches into
the
trunk without insisting on documentation updates. My bad; if the doco is
still wrong, patches will be accepted :).
Clifford Heath