@@ -944,7 +944,7 @@ object Parsers {
944944 lookahead.isArrow
945945 && {
946946 lookahead.nextToken()
947- lookahead.token == INDENT
947+ lookahead.token == INDENT || lookahead.token == EOF
948948 }
949949 lookahead.nextToken()
950950 if lookahead.isIdent || lookahead.token == USCORE then
@@ -1340,11 +1340,16 @@ object Parsers {
13401340 // note: next is defined here because current == NEWLINE
13411341 if (in.token == NEWLINE && p(in.next.token)) newLineOpt()
13421342
1343- def colonAtEOLOpt (): Unit = {
1343+ def acceptIndent () =
1344+ if in.token != INDENT then
1345+ syntaxErrorOrIncomplete(em " indented definitions expected, ${in} found " )
1346+
1347+ def colonAtEOLOpt (): Unit =
13441348 possibleColonOffset = in.lastOffset
13451349 in.observeColonEOL(inTemplate = false )
1346- if in.token == COLONeol then in.nextToken()
1347- }
1350+ if in.token == COLONeol then
1351+ in.nextToken()
1352+ acceptIndent()
13481353
13491354 def argumentStart (): Unit =
13501355 colonAtEOLOpt()
@@ -1364,8 +1369,7 @@ object Parsers {
13641369 if in.lookahead.token == END then in.token = NEWLINE
13651370 else
13661371 in.nextToken()
1367- if in.token != INDENT && in.token != LBRACE then
1368- syntaxErrorOrIncomplete(em " indented definitions expected, ${in} found " )
1372+ if in.token != LBRACE then acceptIndent()
13691373 else
13701374 newLineOptWhenFollowedBy(LBRACE )
13711375
0 commit comments