Skip to content

Commit 02b3f17

Browse files
committed
Added func for Fonctions.
1 parent 96c1b3e commit 02b3f17

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Essentials/Utils/Data.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ namespace FPL::Data {
3939
Map_Variables[newVariable.VariableName] = newVariable;
4040
}
4141

42+
void Data::addFunctionToMap(std::string& name, FPL::Types::Types& type, std::map<std::string, FonctionArgumentDef>& AllFArgs, std::vector<std::string>& Code, int& nArgs, std::string& ReturnValue) {
43+
FonctionDef fonction(name, type, AllFArgs, Code, nArgs, ReturnValue);
44+
Map_Fonctions[fonction.FonctionName] = fonction;
45+
}
46+
4247
bool Data::isVariable(std::string& name) const {
4348
if (Map_Variables.contains(name)) { return true; }
4449
return false;

src/Essentials/Utils/Data.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace FPL::Data {
3636
void updateType(std::string& name, std::string& TypeName, Types::BUILTIN_TYPE Type);
3737

3838
std::optional<FPL::FonctionDef> getFonction(std::string& name);
39+
void addFunctionToMap(std::string& name, FPL::Types::Types& type, std::map<std::string, FonctionArgumentDef>& AllFArgs, std::vector<std::string>& Code, int& nArgs, std::string& ReturnValue);
3940
bool HasReturnValue = false;
4041
std::string ReturnValue = "N/A";
4142
Types::Types ReturnType;

0 commit comments

Comments
 (0)