@@ -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 ‘}’)
@@ -3642,7 +3627,6 @@ object Parsers {
3642
3627
val meths = new ListBuffer [DefDef ]
3643
3628
val exitOnError = false
3644
3629
while ! isStatSeqEnd && ! exitOnError do
3645
- setLastStatOffset()
3646
3630
meths += extMethod(numLeadParams)
3647
3631
acceptStatSepUnlessAtEnd(meths)
3648
3632
if meths.isEmpty then syntaxError(" `def` expected" )
@@ -3781,7 +3765,6 @@ object Parsers {
3781
3765
def topStatSeq (outermost : Boolean = false ): List [Tree ] = {
3782
3766
val stats = new ListBuffer [Tree ]
3783
3767
while (! isStatSeqEnd) {
3784
- setLastStatOffset()
3785
3768
if (in.token == PACKAGE ) {
3786
3769
val start = in.skipToken()
3787
3770
if (in.token == OBJECT ) {
@@ -3843,7 +3826,6 @@ object Parsers {
3843
3826
}
3844
3827
var exitOnError = false
3845
3828
while (! isStatSeqEnd && ! exitOnError) {
3846
- setLastStatOffset()
3847
3829
if (in.token == IMPORT )
3848
3830
stats ++= importClause(IMPORT , mkImport())
3849
3831
else if (in.token == EXPORT )
@@ -3923,7 +3905,6 @@ object Parsers {
3923
3905
val stats = new ListBuffer [Tree ]
3924
3906
var exitOnError = false
3925
3907
while (! isStatSeqEnd && in.token != CASE && ! exitOnError) {
3926
- setLastStatOffset()
3927
3908
if (in.token == IMPORT )
3928
3909
stats ++= importClause(IMPORT , mkImport())
3929
3910
else if (isExprIntro)
0 commit comments