Added args and return type
This commit is contained in:
@@ -241,6 +241,8 @@ shared_ptr<Statement> Parser::matchStatementRawFunction() {
|
||||
|
||||
string name;
|
||||
string constraints;
|
||||
vector<pair<string, shared_ptr<ValueType>>> arguments;
|
||||
shared_ptr<ValueType> returnType = ValueType::NONE;
|
||||
string rawSource;
|
||||
|
||||
// name
|
||||
@@ -260,6 +262,10 @@ shared_ptr<Statement> Parser::matchStatementRawFunction() {
|
||||
markError({TokenKind::GREATER}, {});
|
||||
}
|
||||
|
||||
// arguments
|
||||
|
||||
// return type
|
||||
|
||||
// consume new line
|
||||
if (!tryMatchingTokenKinds({TokenKind::NEW_LINE}, true, true)) {
|
||||
markError(TokenKind::NEW_LINE, {});
|
||||
@@ -281,7 +287,7 @@ shared_ptr<Statement> Parser::matchStatementRawFunction() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return make_shared<StatementRawFunction>(name, constraints, rawSource);
|
||||
return make_shared<StatementRawFunction>(name, constraints, arguments, returnType, rawSource);
|
||||
}
|
||||
|
||||
shared_ptr<Statement> Parser::matchStatementBlock(vector<TokenKind> terminalTokenKinds) {
|
||||
|
||||
Reference in New Issue
Block a user