Skip to content

Commit

Permalink
Version 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Arraying authored and Arraying committed Feb 17, 2018
1 parent 398e547 commit c8952cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/de/arraying/kotys/JSONTokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ private void read()
readString();
break;
default:
if(Character.isDigit(character)) {
if(Character.isDigit(character)
|| character == '-') {
readNumber();
} else if(Character.isLetter(character)) {
readLiteral();
Expand Down Expand Up @@ -284,6 +285,11 @@ private void readNumber()
}
}
String number = builder.toString();
if(number.endsWith(".")) {
throw new IllegalStateException("Numbers cannot end with a decimal point");
} else if(number.endsWith("-")) {
throw new IllegalStateException("Numbers need a value after negative sign");
}
Object value;
if(decimal) {
value = Double.valueOf(number);
Expand Down

0 comments on commit c8952cc

Please sign in to comment.