Skip to content

Commit 990f189

Browse files
author
Simon MacMullen
committed
Deal with // comments.
1 parent 1b7d1ca commit 990f189

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/com/rabbitmq/tools/json/JSONReader.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,22 @@ private char next() {
5959
}
6060

6161
private void skipWhiteSpace() {
62-
while (Character.isWhitespace(c)) {
63-
next();
64-
}
62+
boolean cont;
63+
64+
do {
65+
cont = true;
66+
if (Character.isWhitespace(c)) {
67+
next();
68+
}
69+
else if (c == '/' && next() == '/') {
70+
while (c != '\n') {
71+
next();
72+
}
73+
}
74+
else {
75+
cont = false;
76+
}
77+
} while (cont);
6578
}
6679

6780
public Object read(String string) {

0 commit comments

Comments
 (0)