mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 16:58:56 +00:00
Suppress more (intentional) warnings in xtext test grammars
This commit is contained in:
parent
388cda17b3
commit
99d3b94a32
8 changed files with 20 additions and 3 deletions
|
@ -27,9 +27,16 @@ import org.eclipse.xtext.validation.ValidationMessageAcceptor;
|
|||
*/
|
||||
public class ValidEntryRuleInspector extends XtextRuleInspector<Pair<Boolean, Boolean>, ParserRule>{
|
||||
|
||||
public static final String ISSUE_CODE = "ValidEntryRuleInspector.noInstantiation";
|
||||
|
||||
public ValidEntryRuleInspector(ValidationMessageAcceptor acceptor) {
|
||||
super(acceptor);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getIssueCode() {
|
||||
return ISSUE_CODE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canInspect(ParserRule rule) {
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
grammar org.eclipse.xtext.lexer.BacktrackingLexerTestLanguage hidden(WS, SL_COMMENT)
|
||||
generate backtrackingTestLanguage "http://www.eclipse.org/2008/tmf/xtext/BacktrackingLexerTest"
|
||||
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
|
||||
|
|
|
@ -17,5 +17,6 @@ Element: name=Variable (value=Value)?;
|
|||
|
||||
Variable: ID (('.'|'-') ID)*;
|
||||
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
terminal Value: ('='|'+='|'-=') -> '\n';
|
||||
terminal SL_COMMENT: '#' !('\n'|'\r')* ('\r'? '\n')?;
|
||||
|
|
|
@ -70,7 +70,7 @@ Loop4:
|
|||
LoopBug285452:
|
||||
'#12' (interface?="interface"|"class") name=ID;
|
||||
|
||||
/* SuppressWarnings[potentialOverride] */
|
||||
/* SuppressWarnings[noInstantiation, potentialOverride] */
|
||||
DuplicateBug284491:
|
||||
'#13' (static?='static' | final?='final' | transient?='transient')*;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ Model:
|
|||
CaseInsensitiveKeywordRule:
|
||||
CaseInsensitiveKeyword val=INT;
|
||||
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
terminal CaseInsensitiveKeyword:
|
||||
('k'|'K')('e'|'E')('y'|'Y')('w'|'W')('o'|'O')('r'|'R')('d'|'D');
|
||||
|
||||
|
@ -25,6 +26,7 @@ terminal CaseInsensitiveKeyword:
|
|||
PluralRule:
|
||||
'contents:' count=INT Plural;
|
||||
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
terminal Plural:
|
||||
'item' | 'items';
|
||||
|
||||
|
@ -32,9 +34,11 @@ terminal Plural:
|
|||
MultiRule:
|
||||
'multi' val=INT Multi Multi Multi;
|
||||
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
terminal Multi:
|
||||
'a' 'b'? 'c'+ 'd'* ('e' | 'f') (('g'|'h') | 'i'+) Multi2 '0'..'9' '0'..'9'+;
|
||||
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
terminal Multi2:
|
||||
'j';
|
||||
|
||||
|
|
|
@ -26,7 +26,9 @@ Model:
|
|||
KeywordVal: kw="kw1" | kw="kw2";
|
||||
|
||||
TerminalVal: term=Terminal1 | term=Terminal2 | term="%foo";
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
terminal Terminal1: '%' ('A'..'Z')*;
|
||||
/* SuppressWarnings[InvalidTerminalruleName] */
|
||||
terminal Terminal2: '%' ('a'..'z')*;
|
||||
|
||||
EnumVal: en=Enum1 | en=Enum2;
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.junit.Test;
|
|||
/**
|
||||
* @author Moritz Eysholdt - Initial contribution and API
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class GenericSemanticSequencerTest extends AbstractSemanticSequencerTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -65,7 +65,7 @@ Combination1:
|
|||
Combination2:
|
||||
"#14" val1=ID (("kw1" val2=ID) | (val3+=ID val4+=ID)*);
|
||||
|
||||
/* SuppressWarnings[potentialOverride] */
|
||||
/* SuppressWarnings[noInstantiation, potentialOverride] */
|
||||
Combination3:
|
||||
"#15" (val1=ID | val2=INT | val3=STRING)*;
|
||||
|
||||
|
@ -108,7 +108,7 @@ TransientSerializeables1:
|
|||
enum TransientSerializeables1Enum:
|
||||
lit1 | lit2;
|
||||
|
||||
/* SuppressWarnings[potentialOverride] */
|
||||
/* SuppressWarnings[noInstantiation, potentialOverride] */
|
||||
StaticSimplification:
|
||||
"#26" ("kw1"|{EmptyAlternativeSub}|val1=ID) ("kw2"|val2=ID) ("kw3" ("kw4" (val3=ID)+)?);
|
||||
|
||||
|
|
Loading…
Reference in a new issue