Improving Code Readability (#1004)

This commit is contained in:
dota17 2019-09-17 01:35:48 +08:00 committed by Jordan Bayles
parent 7ef0f9fa5b
commit db61dba885
2 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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;