From c30500e87a65a550062aae2e4832ea0d27939c63 Mon Sep 17 00:00:00 2001 From: extempore Date: Fri, 6 Mar 2009 14:52:22 +0000 Subject: [PATCH] Reverted a small parser change which had the unfortunate side effect of making it much harder to enter code into the interpreter. git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@17252 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 4 ++-- test/files/neg/xmltruncated6.check | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 89019c3b8..70548ab79 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2515,10 +2515,10 @@ trait Parsers extends NewScanners with MarkupParsers { acceptStatSep() } else if (isExprIntro) { stats += statement(InBlock) - if (inToken != RBRACE && inToken != CASE && inToken != EOF) acceptStatSep() + if (inToken != RBRACE && inToken != CASE) acceptStatSep() } else if (isDefIntro || isLocalModifier || in.token == AT) { stats ++= localDef - if (inToken == RBRACE || inToken == CASE || inToken == EOF) { + if (inToken == RBRACE || inToken == CASE) { syntaxError("block must end in result expression, not in definition", false) stats += Literal(()).setPos(inCurrentPos) } else acceptStatSep() diff --git a/test/files/neg/xmltruncated6.check b/test/files/neg/xmltruncated6.check index f638f2f09..612311456 100644 --- a/test/files/neg/xmltruncated6.check +++ b/test/files/neg/xmltruncated6.check @@ -1,4 +1,4 @@ -xmltruncated6.scala:2: error: in XML literal: expected end of Scala block +xmltruncated6.scala:2: error: ';' expected but eof found. val stuff = { "no closing brace" ^ one error found