Rework evaluation to use shared pointers, fix bugs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include "Parser.hpp"
|
||||
#include "ParsedStatements/ParsedStatement.hpp"
|
||||
#include "UnaryOperatorKind.hpp"
|
||||
@@ -65,7 +66,7 @@ ParsedStatement *Parser::ParseAssignment(IToken *current) {
|
||||
return new ParsedAssignmentStatement(isLocal, ((IdentifierToken*)identifier) -> Value, expression, start, expression->GetEndPosition() - start);
|
||||
}
|
||||
|
||||
ParsedStatement *Parser::ParseBlock(vector<TokenKind> endTokens) {
|
||||
ParsedStatement *Parser::ParseBlock(const vector<TokenKind>& endTokens) {
|
||||
vector<ParsedStatement*> statements;
|
||||
while (true){
|
||||
auto next = this -> Next();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <utility>
|
||||
|
||||
#ifndef PORYGONLANG_PARSER_HPP
|
||||
#define PORYGONLANG_PARSER_HPP
|
||||
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "ParsedStatements/ParsedStatement.hpp"
|
||||
#include "../Script.hpp"
|
||||
|
||||
@@ -27,7 +27,7 @@ class Parser {
|
||||
|
||||
ParsedStatement* ParseStatement(IToken* current);
|
||||
ParsedStatement* ParseAssignment(IToken* current);
|
||||
ParsedStatement *ParseBlock(vector<TokenKind> endTokens);
|
||||
ParsedStatement *ParseBlock(const vector<TokenKind>& endTokens);
|
||||
ParsedStatement* ParseFunctionDeclaration(IToken* current);
|
||||
|
||||
ParsedExpression* ParseExpression(IToken* current);
|
||||
|
||||
Reference in New Issue
Block a user