Multiple output node for for mapping label (genContext.pick output example)

Hello,

I am running into an issue with multiple output nodes being possible for a mapping label when trying to retrieve through reference function with genContext.get output <mapping label> for ( <input node> ). After reading https://www.jetbrains.com/help/mps/generator-language.html. it seems that pick output <mapping label> for ( <input node> ) is appropriate in this case as it can make a decision over which output node to use provided it can make a choice from given the currently visible context.

I have tried to use this in a sample project but must be doing something wrong with regard to ensuring the correct criteria/context for this operation to work (e.g. the documentation mentioned ensuring that it may only be used in the context of the referent function in a reference-macro and only if the required output node is a target of the reference).

Is there an available example usage of this operation I am able to reference/work towards.

Thanks!

Tom

 

0
1 comment

You say you must be doing something wrong but how can you tell? What specifically is not working?

'pick output' relies on a correctly implemented scope for the reference so that only one of all the labelled nodes is in scope.

0

Please sign in to leave a comment.