Jump to specific function scope when calling function
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-08 16:44:47 +02:00
parent d385a9e3ee
commit 4d452b33e0
5 changed files with 28 additions and 6 deletions

View File

@@ -82,13 +82,15 @@ class FunctionScriptType : public ScriptType{
shared_ptr<ScriptType> _returnType;
vector<shared_ptr<ScriptType>> _parameterTypes;
vector<shared_ptr<BoundVariableKey>> _parameterKeys;
int _scopeIndex;
public:
FunctionScriptType(std::shared_ptr<ScriptType> returnType, vector<shared_ptr<ScriptType>> parameterTypes,
vector<shared_ptr<BoundVariableKey>> parameterKeys)
vector<shared_ptr<BoundVariableKey>> parameterKeys, int scopeIndex)
: ScriptType(TypeClass::Function){
_returnType = std::move(returnType);
_parameterTypes = std::move(parameterTypes);
_parameterKeys = std::move(parameterKeys);
_scopeIndex = scopeIndex;
}
shared_ptr<ScriptType> GetReturnType(){
return _returnType;
@@ -101,6 +103,10 @@ public:
vector<shared_ptr<BoundVariableKey>> GetParameterKeys(){
return _parameterKeys;
}
int GetScopeIndex(){
return _scopeIndex;
}
};
#endif //PORYGONLANG_SCRIPTTYPE_HPP