mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-19 08:46:41 +01:00
Improving Code Readability (#1004)
This commit is contained in:
parent
7ef0f9fa5b
commit
db61dba885
@ -193,7 +193,7 @@ private:
|
|||||||
|
|
||||||
bool readToken(Token& token);
|
bool readToken(Token& token);
|
||||||
void skipSpaces();
|
void skipSpaces();
|
||||||
bool match(Location pattern, int patternLength);
|
bool match(const Char* pattern, int patternLength);
|
||||||
bool readComment();
|
bool readComment();
|
||||||
bool readCStyleComment();
|
bool readCStyleComment();
|
||||||
bool readCppStyleComment();
|
bool readCppStyleComment();
|
||||||
|
@ -324,7 +324,7 @@ void Reader::skipSpaces() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Reader::match(Location pattern, int patternLength) {
|
bool Reader::match(const Char* pattern, int patternLength) {
|
||||||
if (end_ - current_ < patternLength)
|
if (end_ - current_ < patternLength)
|
||||||
return false;
|
return false;
|
||||||
int index = patternLength;
|
int index = patternLength;
|
||||||
@ -416,7 +416,7 @@ bool Reader::readCppStyleComment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Reader::readNumber() {
|
void Reader::readNumber() {
|
||||||
const char* p = current_;
|
Location p = current_;
|
||||||
char c = '0'; // stopgap for already consumed character
|
char c = '0'; // stopgap for already consumed character
|
||||||
// integral part
|
// integral part
|
||||||
while (c >= '0' && c <= '9')
|
while (c >= '0' && c <= '9')
|
||||||
@ -956,7 +956,7 @@ private:
|
|||||||
|
|
||||||
bool readToken(Token& token);
|
bool readToken(Token& token);
|
||||||
void skipSpaces();
|
void skipSpaces();
|
||||||
bool match(Location pattern, int patternLength);
|
bool match(const Char* pattern, int patternLength);
|
||||||
bool readComment();
|
bool readComment();
|
||||||
bool readCStyleComment();
|
bool readCStyleComment();
|
||||||
bool readCppStyleComment();
|
bool readCppStyleComment();
|
||||||
@ -1287,7 +1287,7 @@ void OurReader::skipSpaces() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OurReader::match(Location pattern, int patternLength) {
|
bool OurReader::match(const Char* pattern, int patternLength) {
|
||||||
if (end_ - current_ < patternLength)
|
if (end_ - current_ < patternLength)
|
||||||
return false;
|
return false;
|
||||||
int index = patternLength;
|
int index = patternLength;
|
||||||
@ -1380,7 +1380,7 @@ bool OurReader::readCppStyleComment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool OurReader::readNumber(bool checkInf) {
|
bool OurReader::readNumber(bool checkInf) {
|
||||||
const char* p = current_;
|
Location p = current_;
|
||||||
if (checkInf && p != end_ && *p == 'I') {
|
if (checkInf && p != end_ && *p == 'I') {
|
||||||
current_ = ++p;
|
current_ = ++p;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user