Reader+Printer: Reorder tokens

This commit is contained in:
Riyyi
2023-03-24 21:51:11 +01:00
parent da0b0a91a6
commit 5c5a766b7e
6 changed files with 54 additions and 54 deletions
+17 -17
View File
@@ -155,6 +155,23 @@ ASTNode* Reader::readSpliceUnquote()
return list;
}
ASTNode* Reader::readList()
{
ignore(); // (
List* list = new List();
while (!isEOF() && peek().type != Token::Type::ParenClose) {
list->addNode(readImpl());
}
if (!consumeSpecific(Token { .type = Token::Type::ParenClose })) { // )
m_error_character = ')';
m_is_unbalanced = true;
}
return list;
}
ASTNode* Reader::readVector()
{
ignore(); // [
@@ -189,23 +206,6 @@ ASTNode* Reader::readHashMap()
return vector;
}
ASTNode* Reader::readList()
{
ignore(); // (
List* list = new List();
while (!isEOF() && peek().type != Token::Type::ParenClose) {
list->addNode(readImpl());
}
if (!consumeSpecific(Token { .type = Token::Type::ParenClose })) { // )
m_error_character = ')';
m_is_unbalanced = true;
}
return list;
}
ASTNode* Reader::readQuote()
{
ignore(); // '