Skip to content
Snippets Groups Projects
Commit ea1e6dd6 authored by Michael Leuschel's avatar Michael Leuschel
Browse files

extract comments for witnesses as desc pragmas

parent 7b15e517
No related branches found
No related tags found
No related merge requests found
Pipeline #151000 passed
......@@ -40,6 +40,7 @@ import org.eventb.core.ISCWitness;
import org.eventb.core.ITraceableElement;
import org.eventb.core.IVariable;
import org.eventb.core.IVariant;
import org.eventb.core.IWitness;
import org.eventb.core.ast.Assignment;
import org.eventb.core.ast.FormulaFactory;
import org.eventb.core.ast.ITypeEnvironment;
......@@ -503,9 +504,19 @@ public class ModelTranslator extends AbstractComponentTranslator {
witness);
final TIdentifierLiteral label = new TIdentifierLiteral(
witness.getLabel());
final IWitness ucw = (IWitness) witness.getSource(); // comments only attached in unchecked
if (ucw.hasAttribute(EventBAttributes.COMMENT_ATTRIBUTE)) {
final String commentString = ucw.getAttributeValue(EventBAttributes.COMMENT_ATTRIBUTE);
final TPragmaFreeText desc = new TPragmaFreeText(commentString);
ADescriptionPragma descPragma = new ADescriptionPragma(Collections.singletonList(desc));
ADescriptionPredicate dpred = new ADescriptionPredicate(descPragma, predicate);
witnessList.add(new AWitness(label, dpred));
labelMapping.put(dpred, witness);
} else {
witnessList.add(new AWitness(label, predicate));
labelMapping.put(predicate, witness);
}
}
return witnessList;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment