递归调用 一次解析完
挨个字符处理, 遇见内容直接就找到内容尾部。
np : now point
bp : begin poing
sp : string poing 匹配完键值后置为0
// 为了快直接判断< 来快速退出
public final void skipWhitespace() {
for (;;) {
if (ch <= '/') {
if (ch == ' ' ||
ch == '\r' ||
ch == '\n' ||
ch == '\t' ||
ch == '\f' ||
ch == '\b') {
next();
continue;
} else if (ch == '/') {
skipComment();
continue;
} else {
break;
}
} else {
break;
}
}
}
评论区