Trouble with the side transform action


I'm trying to reproduce something like VariableDeclaration and its Initializer, that appears when I press the '=' button.

I have one rootable concept Parameter, that implements INamedConcept and has a string property 'value'. Its editor looks like this:
editor for concept Parameter          
  node cell layout:    
    [> {name} ?[> = {value} <] <]

where '=' is a constant cell and the show condition for inner group is

Also it has TransformMenuItem like this:
side transform actions AddInitializer
  right transformed node: Parameter tag: default_ //<no description>
    condition :
      (operationContext, scope, model, sourceNode)->boolean {
    common initializer :
      <no common variables>
      <no common initializer>

    actions :
      add custom items  (output concept: Parameter)
        simple item
          matching text
          description text
          do transform
            (operationContext, scope, model, sourceNode, pattern)->node<> {
              return sourceNode; 

Than I create a new Parameter in the solution, specify some name like 'Param' and press the '=' button. I expect to see something like this:
Param = zero

but nothing happens, the '=' char just added to the parameter name.
What I'm missing?

Comment actions Permalink
The solution was to add a property constraint, that does not allow the '=' char in the name. Unfortunately it's not intuitive enough:(
Comment actions Permalink
Yep, that is the best solution here.  

MPS doesn't restrict the label content by default. All positions in your editor belong to the label, so there is no way to "exit" from the label. Adding any punctuation can help. Almost always when you have a property without quotes, brackets or other delimiters around it you should somehow constraint its content to get rid of the possible ambiguity in the language.

Please sign in to leave a comment.