More work on binder, implements basic literal expressions

This commit is contained in:
2019-05-21 20:59:26 +02:00
parent 2fe6f570ec
commit 80998eab14
7 changed files with 251 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
#include "Script.hpp"
#include "Parser/Lexer.hpp"
#include "Parser/Parser.hpp"
#include "Binder/Binder.hpp"
Script Script::Create(string script) {
auto s = Script();
@@ -13,6 +14,7 @@ Script Script::Create(string script) {
Script::~Script() {
delete this -> Diagnostics;
delete this -> BoundScript;
}
void Script::Parse(string script) {
@@ -24,5 +26,9 @@ void Script::Parse(string script) {
delete token;
}
lexResult.clear();
if (!Diagnostics->HasErrors()){
this->BoundScript = Binder::Bind(parseResult);
}
delete parseResult;
}