mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-16 08:39:59 +07:00
IDEA-80394 (do not ignore whitespaces on collapsing GT/EQ operators)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
PsiJavaFile:Binary2.java
|
||||
PsiAssignmentExpression:a > = b
|
||||
PsiBinaryExpression:a >
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:GT('>')
|
||||
PsiErrorElement:Expression expected
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:EQ('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
@@ -0,0 +1,18 @@
|
||||
PsiJavaFile:Binary3.java
|
||||
PsiAssignmentExpression:a >/**/= b
|
||||
PsiBinaryExpression:a >
|
||||
PsiReferenceExpression:a
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:a('a')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:GT('>')
|
||||
PsiErrorElement:Expression expected
|
||||
<empty list>
|
||||
PsiComment(C_STYLE_COMMENT)('/**/')
|
||||
PsiJavaToken:EQ('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceExpression:b
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:b('b')
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -54,7 +54,7 @@ public class JavaLexerTest extends LexerTestCase {
|
||||
"DOUBLE_LITERAL ('1e137')");
|
||||
}
|
||||
|
||||
public void testTigerNumericLiterals() throws Exception {
|
||||
public void testTigerNumericLiterals() {
|
||||
doTest("0xap0f 0xab.p0F 0x.abcP0f 0xabc.defP0F",
|
||||
"FLOAT_LITERAL ('0xap0f')\nWHITE_SPACE (' ')\n" +
|
||||
"FLOAT_LITERAL ('0xab.p0F')\nWHITE_SPACE (' ')\n" +
|
||||
@@ -115,7 +115,7 @@ public class JavaLexerTest extends LexerTestCase {
|
||||
"DOUBLE_LITERAL ('0xa_bc.de_fP1_234D')");
|
||||
}
|
||||
|
||||
public void testMalformedCoinLiterals() throws Exception {
|
||||
public void testMalformedCoinLiterals() {
|
||||
doTest("0_ _1 0_8 0x_f 0b_1 0B2 0x1.0_p-1 1.0e_1022",
|
||||
"INTEGER_LITERAL ('0')\nIDENTIFIER ('_')\nWHITE_SPACE (' ')\n" +
|
||||
"IDENTIFIER ('_1')\nWHITE_SPACE (' ')\n" +
|
||||
@@ -127,6 +127,13 @@ public class JavaLexerTest extends LexerTestCase {
|
||||
"DOUBLE_LITERAL ('1.0e')\nIDENTIFIER ('_1022')");
|
||||
}
|
||||
|
||||
public void testMalformedOperators() {
|
||||
doTest("(i > = 0)",
|
||||
"LPARENTH ('(')\nIDENTIFIER ('i')\nWHITE_SPACE (' ')\n" +
|
||||
"GT ('>')\nWHITE_SPACE (' ')\nEQ ('=')\n" +
|
||||
"WHITE_SPACE (' ')\nINTEGER_LITERAL ('0')\nRPARENTH (')')\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Lexer createLexer() {
|
||||
return new JavaLexer(LanguageLevel.HIGHEST);
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,6 +32,8 @@ public class ExpressionParserTest extends JavaParsingTestCase {
|
||||
|
||||
public void testBinary0() { doParserTest("a + b"); }
|
||||
public void testBinary1() { doParserTest("a < b"); }
|
||||
public void testBinary2() { doParserTest("a > = b"); }
|
||||
public void testBinary3() { doParserTest("a >/**/= b"); }
|
||||
|
||||
public void testCond0() { doParserTest("cond ? true : false"); }
|
||||
public void testCond1() { doParserTest("cond ?"); }
|
||||
|
||||
Reference in New Issue
Block a user