Renames project.

This commit is contained in:
2020-10-05 17:45:00 +02:00
parent 125bb8459c
commit f299d5183f
23 changed files with 197 additions and 67 deletions

26
src/Parser/Parser.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include "Parser.hpp"
namespace MalachScript::Parser {
ParsedScriptStatement* Parser::Parse() {
std::vector<const ParsedStatement*> statements(32);
size_t current = 0;
while (true) {
auto next = this->Consume();
if (next->GetKind() == LexTokenKind::EndOfFile) {
break;
}
statements[current] = this->ParseStatement(next);
current++;
}
statements.resize(current);
auto end = 0;
if (current > 0) {
end = statements.back()->GetSpan().GetEnd();
}
const auto* block = new ParsedBlockStatement(TextSpan(0, end), statements);
return new ParsedScriptStatement(block);
}
const ParsedStatement* Parser::ParseStatement(const LexToken* token) {
// If modifier (shared, external, private, protected, etc) push to buffer, continue
}
}