@@ -233,15 +233,6 @@ object Parsers {
233233
234234/* ------------- ERROR HANDLING ------------------------------------------- */
235235
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-
245236 /** Is offset1 less or equally indented than offset2?
246237 * This is the case if the characters between the preceding end-of-line and offset1
247238 * are a prefix of the characters between the preceding end-of-line and offset2.
@@ -533,11 +524,8 @@ object Parsers {
533524 if (in.rewriteToIndent) bracesToIndented(body, rewriteWithColon)
534525 else inBraces(body)
535526
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)
541529
542530 /** part { `separator` part }
543531 */
@@ -1538,10 +1526,7 @@ object Parsers {
15381526 else t
15391527
15401528 /** 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 ))
15451530
15461531 /** SimpleEpxr ::= spliceId | ‘$’ ‘{’ Block ‘}’)
15471532 * SimpleType ::= spliceId | ‘$’ ‘{’ Block ‘}’)
@@ -3642,7 +3627,6 @@ object Parsers {
36423627 val meths = new ListBuffer [DefDef ]
36433628 val exitOnError = false
36443629 while ! isStatSeqEnd && ! exitOnError do
3645- setLastStatOffset()
36463630 meths += extMethod(numLeadParams)
36473631 acceptStatSepUnlessAtEnd(meths)
36483632 if meths.isEmpty then syntaxError(" `def` expected" )
@@ -3781,7 +3765,6 @@ object Parsers {
37813765 def topStatSeq (outermost : Boolean = false ): List [Tree ] = {
37823766 val stats = new ListBuffer [Tree ]
37833767 while (! isStatSeqEnd) {
3784- setLastStatOffset()
37853768 if (in.token == PACKAGE ) {
37863769 val start = in.skipToken()
37873770 if (in.token == OBJECT ) {
@@ -3843,7 +3826,6 @@ object Parsers {
38433826 }
38443827 var exitOnError = false
38453828 while (! isStatSeqEnd && ! exitOnError) {
3846- setLastStatOffset()
38473829 if (in.token == IMPORT )
38483830 stats ++= importClause(IMPORT , mkImport())
38493831 else if (in.token == EXPORT )
@@ -3923,7 +3905,6 @@ object Parsers {
39233905 val stats = new ListBuffer [Tree ]
39243906 var exitOnError = false
39253907 while (! isStatSeqEnd && in.token != CASE && ! exitOnError) {
3926- setLastStatOffset()
39273908 if (in.token == IMPORT )
39283909 stats ++= importClause(IMPORT , mkImport())
39293910 else if (isExprIntro)
0 commit comments