mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-15 18:02:11 +00:00
Actually, these are the new function changes
This commit is contained in:
parent
ddf09173e4
commit
4fb5500cc3
@ -573,11 +573,9 @@ int parseSlang(string script)
|
|||||||
// First go through entire script and iterate through all types to see if line is a variable
|
// First go through entire script and iterate through all types to see if line is a variable
|
||||||
// or function declaration, then store it with it's value
|
// or function declaration, then store it with it's value
|
||||||
for (int lineNum = 0; lineNum < (int)words.size(); lineNum++)
|
for (int lineNum = 0; lineNum < (int)words.size(); lineNum++)
|
||||||
for (int t = 0; t < (int)types.size(); t++)
|
|
||||||
if (words[lineNum][0] == types[t])
|
|
||||||
{
|
{
|
||||||
//Checks if it is function
|
//Checks if it is function
|
||||||
if (words[lineNum][(int)words[lineNum].size() - 1][(int)words[lineNum][(int)words[lineNum].size() - 1].size() - 1] == ')')
|
if (words[lineNum][0] == "func")
|
||||||
{
|
{
|
||||||
vector<vector<string>> functionContents;
|
vector<vector<string>> functionContents;
|
||||||
|
|
||||||
@ -609,6 +607,11 @@ int parseSlang(string script)
|
|||||||
functionValues[functName] = functionContents;
|
functionValues[functName] = functionContents;
|
||||||
//cout << functName << " is \n" << Vec2Str(functionContents) << endl << endl;
|
//cout << functName << " is \n" << Vec2Str(functionContents) << endl << endl;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
for (int t = 0; t < (int)types.size(); t++)
|
||||||
|
if (words[lineNum][0] == types[t])
|
||||||
|
{
|
||||||
|
|
||||||
//Checks if it is variable
|
//Checks if it is variable
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -623,6 +626,7 @@ int parseSlang(string script)
|
|||||||
//cout << words[lineNum][1] << " is " << words[lineNum][3] << endl;
|
//cout << words[lineNum][1] << " is " << words[lineNum][3] << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Executes main, which is the starting function
|
// Executes main, which is the starting function
|
||||||
ExecuteFunction("Main", vector<any> {"hi", 0});
|
ExecuteFunction("Main", vector<any> {"hi", 0});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user