@@ -233,15 +233,6 @@ object Parsers {
233
233
234
234
/* ------------- ERROR HANDLING ------------------------------------------- */
235
235
236
- /** The offset of the last time when a statement on a new line was definitely
237
- * encountered in the current scope or an outer scope.
238
- */
239
- private var lastStatOffset = - 1
240
-
241
- def setLastStatOffset (): Unit =
242
- if (mustStartStat && in.isAfterLineEnd)
243
- lastStatOffset = in.offset
244
-
245
236
/** Is offset1 less or equally indented than offset2?
246
237
* This is the case if the characters between the preceding end-of-line and offset1
247
238
* are a prefix of the characters between the preceding end-of-line and offset2.
@@ -533,11 +524,8 @@ object Parsers {
533
524
if (in.rewriteToIndent) bracesToIndented(body, rewriteWithColon)
534
525
else inBraces(body)
535
526
536
- def inDefScopeBraces [T ](body : => T , rewriteWithColon : Boolean = false ): T = {
537
- val saved = lastStatOffset
538
- try inBracesOrIndented(body, rewriteWithColon)
539
- finally lastStatOffset = saved
540
- }
527
+ def inDefScopeBraces [T ](body : => T , rewriteWithColon : Boolean = false ): T =
528
+ inBracesOrIndented(body, rewriteWithColon)
541
529
542
530
/** part { `separator` part }
543
531
*/
@@ -1538,10 +1526,7 @@ object Parsers {
1538
1526
else t
1539
1527
1540
1528
/** The block in a quote or splice */
1541
- def stagedBlock () =
1542
- val saved = lastStatOffset
1543
- try inBraces(block(simplify = true ))
1544
- finally lastStatOffset = saved
1529
+ def stagedBlock () = inBraces(block(simplify = true ))
1545
1530
1546
1531
/** SimpleEpxr ::= spliceId | ‘$’ ‘{’ Block ‘}’)
1547
1532
* SimpleType ::= spliceId | ‘$’ ‘{’ Block ‘}’)
@@ -3643,7 +3628,6 @@ object Parsers {
3643
3628
val meths = new ListBuffer [DefDef ]
3644
3629
val exitOnError = false
3645
3630
while ! isStatSeqEnd && ! exitOnError do
3646
- setLastStatOffset()
3647
3631
meths += extMethod(numLeadParams)
3648
3632
acceptStatSepUnlessAtEnd(meths)
3649
3633
if meths.isEmpty then syntaxError(" `def` expected" )
@@ -3782,7 +3766,6 @@ object Parsers {
3782
3766
def topStatSeq (outermost : Boolean = false ): List [Tree ] = {
3783
3767
val stats = new ListBuffer [Tree ]
3784
3768
while (! isStatSeqEnd) {
3785
- setLastStatOffset()
3786
3769
if (in.token == PACKAGE ) {
3787
3770
val start = in.skipToken()
3788
3771
if (in.token == OBJECT ) {
@@ -3844,7 +3827,6 @@ object Parsers {
3844
3827
}
3845
3828
var exitOnError = false
3846
3829
while (! isStatSeqEnd && ! exitOnError) {
3847
- setLastStatOffset()
3848
3830
if (in.token == IMPORT )
3849
3831
stats ++= importClause(IMPORT , mkImport())
3850
3832
else if (in.token == EXPORT )
@@ -3924,7 +3906,6 @@ object Parsers {
3924
3906
val stats = new ListBuffer [Tree ]
3925
3907
var exitOnError = false
3926
3908
while (! isStatSeqEnd && in.token != CASE && ! exitOnError) {
3927
- setLastStatOffset()
3928
3909
if (in.token == IMPORT )
3929
3910
stats ++= importClause(IMPORT , mkImport())
3930
3911
else if (isExprIntro)
0 commit comments