in rsc/src/main/scala/rsc/scan/java/Scanner.scala [155:215]
private def decimalNumber(): Unit = {
while (isDecimalDigit(ch)) {
nextChar()
}
val default = {
if (ch == '.' && isDecimalDigit(ch1)) {
nextChar()
while (isDecimalDigit(ch)) {
nextChar()
}
LITDOUBLE
} else if (ch == 'e' || ch == 'E') {
LITDOUBLE
} else {
LITINT
}
}
if (ch == 'e' || ch == 'E') {
if (isDecimalDigit(ch1)) {
nextChar()
while (isDecimalDigit(ch)) {
nextChar()
}
} else if ((ch1 == '+' || ch1 == '-') && isDecimalDigit(ch2)) {
nextChar()
nextChar()
while (isDecimalDigit(ch)) {
nextChar()
}
}
}
val parsee = lexeme
val token = {
ch match {
case 'l' | 'L' =>
if (default == LITINT) {
nextChar()
LITLONG
} else {
nextChar()
val message = reportOffset(offset, IllegalNumber)
emit(ERROR, message.str)
return
}
case 'f' | 'F' =>
nextChar()
LITFLOAT
case 'd' | 'D' =>
nextChar()
LITDOUBLE
case _ =>
default
}
}
if (isJavaIdPart(ch)) {
val message = reportOffset(offset, IllegalNumber)
emit(ERROR, message.str)
return
}
emit(token, parsee)
}