Closed alexanderpann closed 5 months ago
Example:
test withElseIfAndElse { node<ClassConcept> node = new node<ClassConcept>(); int result; ifInstanceOf (node is ClassConcept cls) { result = cls.isNotNull ? 0 : 1; } else ifInstanceOf (node is AbstractCatchClause acc) { result = acc.isNotNull ? 2 : 3; } else ifInstanceOf (node is AbstractClassifierReference acr) { result = acr.isNotNull ? 5 : 6; } else { result = 7; } assert 0 equals result ; }
The naming convention comes from IfInstanceOfStatement and maybe the Clause prefix is a bit confusing. I am keeping it that way, I think it is not that important.
IfInstanceOfStatement
Example: