added parsing for function literals
This commit is contained in:
21
src/ast/expressions/function.hpp
Normal file
21
src/ast/expressions/function.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "ast/ast.hpp"
|
||||
#include "ast/expressions/identifier.hpp"
|
||||
#include "ast/statements/block.hpp"
|
||||
#include "token/token.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ast {
|
||||
struct function_literal : expression {
|
||||
function_literal(token::token);
|
||||
token::token token;
|
||||
std::vector<identifier*> parameters;
|
||||
ast::block_stmt* block;
|
||||
|
||||
std::string token_literal() const override;
|
||||
std::string str() const override;
|
||||
~function_literal();
|
||||
};
|
||||
} // namespace ast
|
Reference in New Issue
Block a user