File tree Expand file tree Collapse file tree 6 files changed +12
-8
lines changed
src/org/jetbrains/plugins/scala/lang/parser/parsing
test/org/jetbrains/plugins/scala/lang/parser/scala3 Expand file tree Collapse file tree 6 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -63,4 +63,8 @@ trait ScalaPsiBuilder extends PsiBuilder {
6363 final def wrongExpressionError (): Unit = {
6464 error(ErrMsg (" wrong.expression" ))
6565 }
66+
67+ final def expressionExpectedError (): Unit = {
68+ error(ErrMsg (" expression.expected" ))
69+ }
6670}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ object Enumerator extends ParsingRule {
2121 case ScalaTokenTypes .tASSIGN =>
2222 builder.advanceLexer() // Ate =
2323 if (! ExprInIndentationRegion ()) {
24- builder.wrongExpressionError ()
24+ builder.expressionExpectedError ()
2525 }
2626 enumeratorMarker.done(ScalaElementType .FOR_BINDING )
2727 true
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ object Generator extends ParsingRule {
2727 builder.advanceLexer()
2828
2929 if (! ExprInIndentationRegion ()) {
30- builder.wrongExpressionError ()
30+ builder.expressionExpectedError ()
3131 }
3232 genMarker.done(ScalaElementType .GENERATOR )
3333 builder.getTokenType match {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ object FunDef extends ParsingRule {
4242 true
4343 }
4444 else {
45- builder.wrongExpressionError ()
45+ builder.expressionExpectedError ()
4646 faultMarker.drop()
4747 true
4848 }
@@ -59,7 +59,7 @@ object FunDef extends ParsingRule {
5959 true
6060 }
6161 else {
62- builder.error( ScalaBundle .message( " expression.expected " ) )
62+ builder.expressionExpectedError( )
6363 faultMarker.drop()
6464 true
6565 }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ object PatDef extends ParsingRule {
5353 builder.checkedAdvanceLexer()
5454
5555 if (! ExprInIndentationRegion ()) {
56- builder.error( ErrMsg ( " expression.expected " ) )
56+ builder.expressionExpectedError( )
5757 }
5858
5959 patDefMarker.drop()
Original file line number Diff line number Diff line change @@ -2644,7 +2644,7 @@ class ExprParserTest extends SimpleScala3ParserTestBase {
26442644 | PsiElement(identifier)('String')
26452645 | PsiWhiteSpace(' ')
26462646 | PsiElement(=)('=')
2647- | PsiErrorElement:Wrong expression
2647+ | PsiErrorElement:Expression expected
26482648 | <empty list>
26492649 | PsiWhiteSpace('\n\n ')
26502650 | ScPatternDefinition: value1
@@ -2764,7 +2764,7 @@ class ExprParserTest extends SimpleScala3ParserTestBase {
27642764 | PsiElement(identifier)('x')
27652765 | PsiWhiteSpace(' ')
27662766 | PsiElement(<-)('<-')
2767- | PsiErrorElement:Wrong expression
2767+ | PsiErrorElement:Expression expected
27682768 | <empty list>
27692769 | PsiWhiteSpace(' ')
27702770 | PsiElement(})('}')
@@ -2784,7 +2784,7 @@ class ExprParserTest extends SimpleScala3ParserTestBase {
27842784 | PsiElement(identifier)('y')
27852785 | PsiWhiteSpace(' ')
27862786 | PsiElement(<-)('<-')
2787- | PsiErrorElement:Wrong expression
2787+ | PsiErrorElement:Expression expected
27882788 | <empty list>
27892789 | PsiWhiteSpace(' ')
27902790 | PsiElement(})('}')
You can’t perform that action at this time.
0 commit comments