Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #404 from eclipse/sz_gh341
Browse files Browse the repository at this point in the history
Problem with content assist and grammar fragments
  • Loading branch information
szarnekow committed Sep 6, 2017
2 parents d8a45bc + 7be950d commit 278a115
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,22 @@ public void announceEof(int lookAhead) {
delegate.announceEof(lookAhead);
}

@Override
public void reportError(RecognitionException e) {
if (strict) {
if ( state.errorRecovery ) {
return;
}
if (e.index != input.size()) {
// don't count errors at EOF in strict mode
state.syntaxErrors++;
}
state.errorRecovery = true;
} else {
super.reportError(e);
}
}

@Override
public void announceConsume() {
if (marked <= 0)
Expand Down
3 changes: 1 addition & 2 deletions org.eclipse.xtext/src/org/eclipse/xtext/GrammarUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ public static boolean isAssignedEObjectRuleCall(EObject ele) {
public static boolean isDatatypeRuleCall(EObject grammarElement) {
if (grammarElement instanceof RuleCall) {
AbstractRule calledRule = ((RuleCall) grammarElement).getRule();
return calledRule != null && calledRule instanceof ParserRule
&& calledRule.getType() != null && calledRule.getType().getClassifier() instanceof EDataType;
return calledRule != null && isDatatypeRule(calledRule);
}
return false;
}
Expand Down

0 comments on commit 278a115

Please sign in to comment.