mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[263773] Incorporated review comments
This commit is contained in:
parent
9572595662
commit
6627e289a7
2 changed files with 5 additions and 3 deletions
|
@ -194,9 +194,11 @@ public class GrammarUtil {
|
|||
public static boolean isEObjectRule(EObject grammarElement) {
|
||||
if (grammarElement instanceof ParserRule) {
|
||||
ParserRule rule = (ParserRule) grammarElement;
|
||||
if (rule.isWildcard()) {
|
||||
return true;
|
||||
}
|
||||
TypeRef type = rule.getType();
|
||||
// wildcard fragments are considered to be EObjectRules, too
|
||||
return type == null || type.getClassifier() instanceof EClass;
|
||||
return type != null && type.getClassifier() instanceof EClass;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -278,6 +278,6 @@ public class GrammarParserTest extends AbstractEnumRulesTest {
|
|||
assertEquals(grammar.eResource().getErrors().toString(), 1, grammar.eResource().getErrors().size());
|
||||
TransformationDiagnostic diag = (TransformationDiagnostic) grammar.eResource().getErrors().get(0);
|
||||
int offset = diag.getOffset();
|
||||
assertEquals(modelAsString.lastIndexOf("enum ExistingEnum"), offset);
|
||||
assertEquals(modelAsString.lastIndexOf("ExistingEnum"), offset);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue