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