Skip to content
Snippets Groups Projects
Commit c84b500c authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

name of enumeration may differ from id of EnumType

parent 71685548
No related branches found
No related tags found
1 merge request!13Resolve "enumeration name may differ"
...@@ -89,15 +89,16 @@ public class EnumerationValidator extends TypeValidator { ...@@ -89,15 +89,16 @@ public class EnumerationValidator extends TypeValidator {
new Object[] { ada } )); new Object[] { ada } ));
res = false; res = false;
} }
if( ! getName().equals( ada.getType() )) { // Name may differ
diagnostics.add( new BasicDiagnostic( // if( ! getName().equals( ada.getType() )) {
Diagnostic.ERROR, // diagnostics.add( new BasicDiagnostic(
RiseClipseValidatorSCL.DIAGNOSTIC_SOURCE, // Diagnostic.ERROR,
0, // RiseClipseValidatorSCL.DIAGNOSTIC_SOURCE,
"[NSD validation] type of DA/BDA \"" + ada.getName() + "\" (line = " + ada.getLineNumber() + ") is not " + getName(), // 0,
new Object[] { ada } )); // "[NSD validation] type of DA/BDA \"" + ada.getName() + "\" (line = " + ada.getLineNumber() + ") is not " + getName(),
res = false; // new Object[] { ada } ));
} // res = false;
// }
for( Val val : ada.getVal() ) { for( Val val : ada.getVal() ) {
res = validateValue( ada, val.getValue(), diagnostics ) && res; res = validateValue( ada, val.getValue(), diagnostics ) && res;
} }
...@@ -192,7 +193,8 @@ public class EnumerationValidator extends TypeValidator { ...@@ -192,7 +193,8 @@ public class EnumerationValidator extends TypeValidator {
} }
} }
// TODO: do we have to check that all literals in Enumeration are present as EnumVal ? // we do not have to check that all literals in Enumeration are present as EnumVal
// See comment in issue #13
return res; return res;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment