File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1177,7 +1177,7 @@ object Parsers {
1177
1177
case _ =>
1178
1178
if (isLiteral) literal()
1179
1179
else {
1180
- syntaxErrorOrIncomplete(" illegal start of simple expression " )
1180
+ syntaxErrorOrIncomplete(IllegalStartSimpleExpr (tokenString(in.token)) )
1181
1181
errorTermTree
1182
1182
}
1183
1183
}
Original file line number Diff line number Diff line change @@ -482,4 +482,22 @@ object messages {
482
482
|but an uninitialized var definition
483
483
""" .stripMargin
484
484
}
485
+
486
+ case class IllegalStartSimpleExpr (illegalToken : String )(implicit ctx : Context ) extends Message (17 ) {
487
+ val kind = " Syntax"
488
+ val msg = " illegal start of simple expression"
489
+ val explanation = {
490
+ hl """ |An expression yields a value. In the case of the simple expression, this error
491
+ |commonly occurs when there's a missing parenthesis or brace. The reason being
492
+ |that a simple expression is one of the following:
493
+ |
494
+ |- Block
495
+ |- Expression in parenthesis
496
+ |- Identifier
497
+ |- Object creation
498
+ |- Literal
499
+ |
500
+ |which cannot start with ${Red (illegalToken)}. """ .stripMargin
501
+ }
502
+ }
485
503
}
You can’t perform that action at this time.
0 commit comments