@@ -180,7 +180,7 @@ object Scanners {
180180 private [this ] var docstringMap : SortedMap [Int , Comment ] = SortedMap .empty
181181
182182 private [this ] def addComment (comment : Comment ): Unit = {
183- val lookahead = lookaheadReader
183+ val lookahead = lookaheadReader()
184184 def nextPos : Int = (lookahead.getc(): @ switch) match {
185185 case ' ' | '\t ' => nextPos
186186 case CR | LF | FF =>
@@ -863,7 +863,7 @@ object Scanners {
863863 nextChar()
864864 }
865865 if (ch == 'e' || ch == 'E' ) {
866- val lookahead = lookaheadReader
866+ val lookahead = lookaheadReader()
867867 lookahead.nextChar()
868868 if (lookahead.ch == '+' || lookahead.ch == '-' ) {
869869 lookahead.nextChar()
@@ -907,36 +907,10 @@ object Scanners {
907907 }
908908 token = INTLIT
909909 if (base == 10 && ch == '.' ) {
910- val isDefinitelyNumber = {
911- val lookahead = lookaheadReader
912- val c = lookahead.getc()
913- (c : @ switch) match {
914- /** Another digit is a giveaway. */
915- case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' =>
916- true
917-
918- /** Backquoted idents like 22.`foo`. */
919- case '`' =>
920- false
921-
922- /** These letters may be part of a literal, or a method invocation on an Int.
923- */
924- case 'd' | 'D' | 'f' | 'F' =>
925- ! isIdentifierPart(lookahead.getc())
926-
927- /** A little more special handling for e.g. 5e7 */
928- case 'e' | 'E' =>
929- val ch = lookahead.getc()
930- ! isIdentifierPart(ch) || (isDigit(ch) || ch == '+' || ch == '-' )
931-
932- case x =>
933- ! isIdentifierStart(x)
934- }
935- }
936- if (isDefinitelyNumber) {
937- putChar(ch)
938- nextChar()
939- getFraction()
910+ val lookahead = lookaheadReader()
911+ lookahead.nextChar()
912+ if ('0' <= lookahead.ch && lookahead.ch <= '9' ) {
913+ putChar('.' ); nextChar(); getFraction()
940914 }
941915 } else (ch : @ switch) match {
942916 case 'e' | 'E' | 'f' | 'F' | 'd' | 'D' =>
0 commit comments