Renames project.
This commit is contained in:
26
src/Parser/Parser.cpp
Normal file
26
src/Parser/Parser.cpp
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user