Make a lot of one-liner functions inline
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2019-07-04 19:08:13 +02:00
parent bb0a6aba19
commit 32836c6c58
53 changed files with 428 additions and 424 deletions

View File

@@ -14,10 +14,10 @@ namespace Porygon::Parser {
}
vector<const IToken *> Lexer::Lex() {
vector<const IToken *> tokens;
vector<const Token *> Lexer::Lex() {
vector<const Token *> tokens;
while (true) {
IToken *next = this->LexNext(this->Next());
Token *next = this->LexNext(this->Next());
auto nextKind = next->GetKind();
if (nextKind != TokenKind::WhiteSpace)
tokens.push_back(next);
@@ -41,7 +41,7 @@ namespace Porygon::Parser {
return next;
}
IToken *Lexer::LexNext(char16_t c) {
Token *Lexer::LexNext(char16_t c) {
switch (c) {
case '\0':
return new SimpleToken(TokenKind::EndOfFile, this->_position - 1, 1);
@@ -154,7 +154,7 @@ namespace Porygon::Parser {
}
}
IToken *Lexer::LexNumber(char16_t c) {
Token *Lexer::LexNumber(char16_t c) {
long int_value = CharToInt(c);
double float_value = 0;
short decimal_index = 0;
@@ -201,7 +201,7 @@ namespace Porygon::Parser {
}
}
IToken *Lexer::LexIdentifierOrKeyword() {
Token *Lexer::LexIdentifierOrKeyword() {
auto start = this->_position - 1;
auto end = start;
while (true) {
@@ -275,7 +275,7 @@ namespace Porygon::Parser {
{'\\', '\\'},
};
IToken *Lexer::LexString(char16_t c) {
Token *Lexer::LexString(char16_t c) {
auto start = this->_position - 1;
auto end = start;
char16_t last = c;