Hi. I need some help refining editor behaviour.
Suppose we want to build something resembling Scala's generics with upper bounds, for instance there can be a List[Bar] and a List[Foo < Bar]. Lets call "Bar" an upper bound, and "Foo" is an (optional) default type.
ListType concept then naturally has
upperBound : Type
defaultType : Type[0..1]
and ListTypeEditor looks something like
[- List [ ?[- % defaultType % < -] % upperBound % ] -]
where "defaultType <" part is shown conditionally.
Now the question: how to implement the following:
1. Typing "<" before %upperBound% adds new defaultType
2. Typing "<" after %upperBould% sets defaultType to upperBound and upperBound to new empty node
I tried playing with keymaps (defining "<" event on upperBound) and side transform actions but MPS just makes "<" symbol part of the upperBound name.